2016-08-12 14:22:32 -0400, Chet Ramey:
[...]
> The relevant change was probably the change in the set of commands to which
> `set -e' applies.  The (( command (among others) was added to that list
> in bash-4.1.  The change was the result of Posix changing the semantics
> of the errexit option and expanding its scope from simple commands to
> all commands.
> 
> The (( command returns 1 if the expression evaluates to 0.  When `level' is
> 0, level++ returns a 0 value, and (( returns a status of 1.
[...]

POSIX doesn't specify ((...)) (explicitely leaves it
unspecified), so is out of POSIX scope anyway.

It was introduced by ksh88.

There and in ksh93 (but not pdksh nor zsh)

ksh -c '((0)); echo X'

outputs X

For:

ksh -ec '[[ -z . ]]; echo X'

I see a difference between ksh88 (Solaris /usr/bin/ksh) which
displays the X (like bash<4.1) and ksh93 (u+) which doesn't any more.

In any case, I'd go with Greg's advice to avoid "set -e".

-- 
Stephane

Reply via email to