On 12/12/2010 12:51 PM, Christopher Faylor wrote: >>> `-e' >>> Exit immediately if a simple command (*note Simple >>> Commands::) exits with a non-zero status, unless the command >>> that fails is part of the command list immediately following >>> a `while' or `until' keyword, part of the test in an `if' >>> statement, part of a `&&' or `||' list, or if the command's >>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^ >>> return status is being inverted using `!'. A trap on `ERR', >>> if set, is executed before the shell exits. >>> >> >> Yes, in theory. In practice, I've seen too many shells goof this up. > > Maybe in 1986 there was a shell which didn't do this properly under Ultrix. > I sincerely doubt that any modern shell has a problem.
Then you seriously underestimate the non-portability of 'set -e', even between different versions of bash. When the POSIX specification for 'set -e' had to be changed yet again just this year to try and tighten down all the subtleties, it's no wonder that shells vary widely in its implementation. http://www.gnu.org/software/autoconf/manual/autoconf.html#index-g_t_0040command_007bset_007d-1719 http://austingroupbugs.net/view.php?id=52 -- Eric Blake ebl...@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature