bug-bash
[Top][All Lists]
Advanced

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

Re: exit status question


From: Curtis Doty
Subject: Re: exit status question
Date: Mon, 20 Dec 2010 10:38:11 -0800 (PST)

11:30am Eric Blake said:

On 12/20/2010 11:25 AM, Curtis Doty wrote:
Not exactly sure if this is a bug. But I don't understand why only the
first time running ((i++)) returns an error exit status.

Because it follows the same semantics as 'expr', where status 1 is
reserved for a successful run with value 0, and status 2 and above are
reserved for errors.  This was just brought up on the list earlier this
month:
http://lists.gnu.org/archive/html/bug-bash/2010-12/msg00087.html

and seems to be a recurring question:
http://lists.gnu.org/archive/html/bug-bash/2010-07/msg00121.html


The workaround of using ((++i)) seems to work. Thanks for the cluebat! Sounds like this is a FAQ.

../C




reply via email to

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