-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to [EMAIL PROTECTED] on 5/19/2008 7:16 AM: | | Bash Version: 3.1 | Patch Level: 17
Consider upgrading. Bash is at 3.2, patch level 39. However, it also exhibits the same behavior. | | Today I recognized a strange behavior of Bash with set -e and operator || (same for && as well). POSIX states: When this option is on, if a simple command fails for any of the reasons listed in Consequences of Shell Errors or returns an exit status value >0, and is not part of the compound list following a while, until, or if keyword, and is not a part of an AND or OR list, and is not a pipeline preceded by the ! reserved word, then the shell shall immediately exit. http://www.opengroup.org/onlinepubs/009695399/utilities/set.html As worded, this is slightly ambiguous - you can argue, as ash does, that all simple commands in the subshell are subject to the most recent 'set - -e' also in that subshell; or you can argue, as bash, ksh, and zsh do, that the entire subshell is part of an exempt compound list, therefore the setting or clearing of 'set -e' in the subshell is irrelevant since the entire subshell is exempt. If you need more clarification, I would ask on the Austin Group mailing list if this ambiguity was intended. - -- Don't work too hard, make some time for fun as well! Eric Blake [EMAIL PROTECTED] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkgyJlMACgkQ84KuGfSFAYALcACg19ByNDCtc8KO6hVaMIIT0fPL 1JsAnRWwG5PJJtqbI46cH67JXlzBuFCS =Neop -----END PGP SIGNATURE-----