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
which also exits and should not, and by:
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
- in comp.unix.questions on Usenet, 20 February 1990