bug-bash
[Top][All Lists]
Advanced

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

Re: i++ cause bad return code when result is 1


From: Chris Down
Subject: Re: i++ cause bad return code when result is 1
Date: Mon, 19 Aug 2013 05:50:31 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

On 2013-08-18 16:57, David Lehmann wrote:
> The ((i++)) fails only when the result is 1.  When the result is 0 or 2, it
> does not fail.  This is a problem when 'set -e'.

This is normal and expected. If the value returned in an (( expression is zero,
then the exit code is 1. Since you're using a postincrement, zero is returned,
and then i is incremented to 1.

Attachment: pgp5ZDcbn2n98.pgp
Description: PGP signature


reply via email to

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