[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question about arithmetic logic.

From: Greg Wooledge
Subject: Re: Question about arithmetic logic.
Date: Mon, 18 Apr 2011 10:40:14 -0400
User-agent: Mutt/

On Mon, Apr 18, 2011 at 10:30:35AM -0400, Steven W. Orr wrote:
> ss=1
> (( ss ))
> echo $?               # Also says 1. Should this be 0 because it should be 
> the
>                 # success result same as (( ss != 0 ))

That's not what I get:

imadev:~$ unset ss; ss=0; ((ss)); echo $?
imadev:~$ unset ss; ss=1; ((ss)); echo $?

I use flag variables like this all the time.  The only difference is
that I do not use "typeset -i" on them.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]