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