Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Airthmetic confusion...



On Mon, 16 May 2005 16:59:27 -0400
Mike Hernandez <sequethin@xxxxxxxxx> wrote:

> Actually what happens is that the operation and assignment are
> performed but the return code of the expression evaluates to 1, which
> is an error. I tried on my machine and get the same results:
> 
> (mike@mhernandez)(24/pts)(04:45pm:05/16/05)-
> (%:~)- (( x = 0 ))
> (mike@mhernandez)(25/pts)(04:46pm:05/16/05)-
> (%:~)- echo $?
> 1
> (mike@mhernandez)(26/pts)(04:46pm:05/16/05)-
> (%:~)- echo $x
> 0

I hope, I don't missunderstood ... the first posting, but 'echo $x' is
'0'. So the value of 'x' is calculated correctly, but the returncode is
false.
 
> There must be a reason why assigning 0 to a variable is considered an
> error (a reason which I could speculate about, but don't know for
> sure).

Are you sure there is a reason or isn't it probably a bug?


Matthias Berndt



Messages sorted by: Reverse Date, Date, Thread, Author