Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #11573

Re: command substitution is stripping set -e from options

From Christoph Gysin <christoph.gysin@gmail.com>
Newsgroups gnu.bash.bug
Subject Re: command substitution is stripping set -e from options
Date 2015-10-02 14:25 +0300
Message-ID <mailman.270.1443788219.16064.bug-bash@gnu.org> (permalink)
References <CADex794C1jOf0wrB298_O4ohAqZghYUdd9DJcuaOvV1dCP5AOQ@mail.gmail.com> <560D9539.2040009@case.edu>

Show all headers | View raw


> Yes, it's how bash has always behaved, at least back to bash-1.14 when
> I stopped looking.  Around bash-2.05, it changed to preserve the -e
> option when in Posix mode.

Is there any reason not to preserve it?

> That exception from default bash behavior is documented in the Posix
> Mode section of the texinfo manual.

Thanks, the bash manpage indeed references:

http://tiswww.case.edu/php/chet/bash/POSIX

(btw: would it make sense to add this as a manpage, e.g. as bash-posix?)

The relevant point seems to be:

 36. Subshells spawned to execute command substitutions inherit the
     value of the `-e' option from the parent shell.  When not in POSIX
     mode, Bash clears the `-e' option in such subshells.

Now I'm still curious why this isn't the default behaviour in bash?

Thanks,
Chris
-- 
echo mailto: NOSPAM !#$.'<*>'|sed 's. ..'|tr "<*> !#:2" org@fr33z3

Back to gnu.bash.bug | Previous | Next | Find similar


Thread

Re: command substitution is stripping set -e from options Christoph Gysin <christoph.gysin@gmail.com> - 2015-10-02 14:25 +0300

csiph-web