The Bourne shell -e option should stop execution when a command returns a non-zero status. Does your -e option seem to cause some if commands to abort scripts? If so, you have a copy of the Buggy Bourne Shell, as distributed with 4.2BSD, 4.3BSD, and probably several other systems. It can be identified by running:
and noting that the shell exits instead of printing
ok, and by:
which also exits and should not, and by:
while false; do :; done
To fix it, first get the source, and then change it in the obvious three places in xec.c. You will have to learn Bournegol [the ALGOL-like dialect of C that Steve Bourne used to write the original Bourne shell-JP ]. Another alternative is to replace /bin/sh with one of the , provided you can find one that is enough alike.
As a workaround, you can
set +e around all the tests that might fail.
Unfortunately, some versions of the Buggy Bourne Shell do not even support
set +e; here the only workaround is to run a
the -e flag.
- in comp.unix.questions on Usenet, 20 February 1990