]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Document Solaris/Heirloom sh set -e issue with command substitutions.
authorStefano Lattarini <stefano.lattarini@gmail.com>
Sat, 5 Dec 2009 11:56:30 +0000 (12:56 +0100)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sat, 5 Dec 2009 13:00:42 +0000 (14:00 +0100)
* doc/autoconf.texi (Limitations of Builtins): Fix typos `set -d'
in previous example.  Document failure to honor && lists with set -e
and a command substitution in the failing command.
Report and initial patch by Stefano Lattarini against Automake.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
ChangeLog
doc/autoconf.texi

index e03604d6098c0a6e2f493c32832514bd9bc95ca3..1c0c6120f2cc1ad0f902c409cbde42c9996d4189 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2009-12-05  Stefano Lattarini  <stefano.lattarini@gmail.com>
+           Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       Document Solaris/Heirloom sh set -e issue with command substitutions.
+       * doc/autoconf.texi (Limitations of Builtins): Fix typos `set -d'
+       in previous example.  Document failure to honor && lists with set -e
+       and a command substitution in the failing command.
+       Report and initial patch by Stefano Lattarini against Automake.
+
 2009-12-04  Eric Blake  <ebb9@byu.net>
 
        Warn if using unnamed diversion.
index 7d2c72ead2dcf89e9f0c07ae5383e9d13fda5737..3144610aefb2e838bf8648c1baf171be9b4ec45f 100644 (file)
@@ -16794,12 +16794,23 @@ When @samp{set -e} is in effect, a failed command substitution in
 Solaris @command{/bin/sh} cannot be ignored, even with @samp{||}.
 
 @example
-$ @kbd{/bin/sh -c 'set -d; foo=`false` || echo foo; echo bar'}
-$ @kbd{bash -c 'set -d; foo=`false` || echo foo; echo bar'}
+$ @kbd{/bin/sh -c 'set -e; foo=`false` || echo foo; echo bar'}
+$ @kbd{bash -c 'set -e; foo=`false` || echo foo; echo bar'}
 foo
 bar
 @end example
 
+@noindent
+Moreover, a command substitution, successful or not, causes this shell to
+exit from a failing outer command even in presence of an @samp{&&} list:
+
+@example
+$ @kbd{bash -c 'set -e; false `true` && echo notreached; echo ok'}
+ok
+$ @kbd{sh -c 'set -e; false `true` && echo notreached; echo ok'}
+$
+@end example
+
 Portable scripts should not use @samp{set -e} if @command{trap} is used
 to install an exit handler.  This is because Tru64/OSF 5.1 @command{sh}
 sometimes enters the trap handler with the exit status of the command