On Fri, 8 Oct 2010, Jason McIntyre wrote: ... > On Fri, Oct 08, 2010 at 08:34:54PM +0200, Tilo Stritzky wrote: > > >Description: > > When a command list contains && or ||, a set errexit option > > does not cause the shell to exit if the last command in the > > list returns non-zero. > > >How-To-Repeat: > > /bin/sh -ec 'true && false ; echo $?, still alive' > > /bin/ksh -ec 'false || false ; echo $?, still alive' > > the description of -e says as much: > > -e | errexit > Exit (after executing the ERR trap) as soon as an error occurs or > a command fails (i.e. exits with a non-zero status). This does > not apply to commands whose exit status is explicitly tested by a > shell construct such as if, until, while, &&, ||, or ! statements.
The issue isn't that the behavior and the documentation don't match. The issue, perhaps not clearly stated, is that the behavior isn't what is required by POSIX/SUS. Philip Guenther
