On 30/07/10 19:55, Stefano Lattarini wrote:
At Thursday 29 July 2010, Andrew Benton wrote:
andy:~$ count=0
andy:~$ ((count++))
andy:~$ echo $?
1
andy:~$ ((count++))
andy:~$ echo $?
0
I don't think it's a bug, it's just an effect of:
1. `((EXPR))' returning a non-zero exit status iff EXPR evaluates
to zero, and
That makes no sense to me. Why would evaluating an expression have a
non-zero exit status if there was no error? That makes the exit status
no use at all for evaluating whether an error has occurred. How can I
check for errors if I can't rely on the exit status? How can that not be
a bug?
Andy