|
From: | Andrew Benton |
Subject: | Re: inconsistent exit status of ((count++)) |
Date: | Fri, 30 Jul 2010 19:33:00 +0100 |
User-agent: | Mozilla/5.0 (X11; Linux i686; rv:2.0b3pre) Gecko/20100728 Shredder/3.2a1pre |
On 30/07/10 19:55, Stefano Lattarini wrote:
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?At Thursday 29 July 2010, Andrew Benton wrote:andy:~$ count=0 andy:~$ ((count++)) andy:~$ echo $? 1 andy:~$ ((count++)) andy:~$ echo $? 0I 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
Andy
[Prev in Thread] | Current Thread | [Next in Thread] |