[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] manpage clarification wrt "set -e" and || lists
From: |
dwitch |
Subject: |
[PATCH] manpage clarification wrt "set -e" and || lists |
Date: |
Tue, 20 Nov 2007 23:41:12 +0100 (CET) |
Configuration Information [Automatically generated, do not change]:
Machine: i486
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i486'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i486-pc-linux-gnu'
-DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL
-DHAVE_CONFIG_H -I. -I../bash -I../bash/include -I../bash/lib -g -O2
uname output: Linux gandelf 2.6.19.1-smp #1 SMP Sat Dec 16 13:55:31 CET 2006
i686 GNU/Linux
Machine Type: i486-pc-linux-gnu
Bash Version: 3.1
Patch Level: 17
Release Status: release
Description:
As worded, the documentation does not make it clear what the
behaviour of some scripts is under "set -e". For reference,
this was discussed earlier today on #bash on Freenode.
To be precise, there is an ambiguity in what means "being part
of" a particular construct. It is easy to interpret this as
"directly part of", whereas all shells at hand are consistent
in this behaviour:
$ bash -ec '(echo 1; false; echo 2); echo 4'
1
4
$ bash -ec '(echo 1; false; echo 2) || echo 3; echo 4'
1
2
4
$ bash -ec 'foo() { echo 1; false; echo 2; }; foo'
1
$ bash -ec 'foo() { echo 1; false; echo 2; }; foo || echo bar'
1
2
Fix:
--- - 2007-11-20 23:27:34.638502222 +0100
+++ bash.1 2007-11-20 23:20:33.000000000 +0100
@@ -7617,7 +7617,8 @@
.B &&
or
.B \(bv\(bv
-list, or if the command's return value is
+list, or run by a subshell which is part of such a list, or run by a
+function called within such a list, or if the command's return value is
being inverted via
.BR ! .
A trap on \fBERR\fP, if set, is executed before the shell exits.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [PATCH] manpage clarification wrt "set -e" and || lists,
dwitch <=