Re: EXIT trap in implicit vs. explicit pipeline subshell

2015-06-14 Thread Chet Ramey
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 6/13/15 8:05 AM, Miroslav Koskar wrote: > You didn't seem to have replied on that code snippet I provided before. > I assume, that inconsistency in BASH_SUBSHELL inside {...} invoked > directly and invoked inside EXIT trap, should be fixed one way

Re: EXIT trap in implicit vs. explicit pipeline subshell

2015-06-13 Thread Miroslav Koskar
On Jun 12 11:40, Chet Ramey wrote: > > I'm going to think about whether I should document the status quo or expand > the definition of `subshell' that $BASH_SUBSHELL reflects. It seems like > group commands in pipelines (and the exit traps they run) would be a good > candidate for such an expansi

Re: EXIT trap in implicit vs. explicit pipeline subshell

2015-06-12 Thread Chet Ramey
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 6/12/15 1:25 AM, Miroslav Koskar wrote: > On Jun 11 09:35, Chet Ramey wrote: >> On 6/11/15 4:08 AM, Miroslav Koskar wrote: >> >>> In fact group command { ... } would work too, as I've showed and you've >>> confirmed. One last bit here I guess, why i

Re: EXIT trap in implicit vs. explicit pipeline subshell

2015-06-11 Thread Miroslav Koskar
On Jun 11 09:35, Chet Ramey wrote: > On 6/11/15 4:08 AM, Miroslav Koskar wrote: > > > In fact group command { ... } would work too, as I've showed and you've > > confirmed. One last bit here I guess, why is it that the $BASH_SUBSHELL, > > would not reflect that is it in fact running in subshell? >

Re: EXIT trap in implicit vs. explicit pipeline subshell

2015-06-11 Thread Chet Ramey
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 6/11/15 4:08 AM, Miroslav Koskar wrote: >> So the idea is that the output of `trap' can be piped. This came in in >> Posix-2008 and bash-4.2. > > I've forgot to check POSIX for this, that's a good point. So to get > list of traps corresponding to

Re: EXIT trap in implicit vs. explicit pipeline subshell

2015-06-11 Thread Miroslav Koskar
On Jun 09 07:39, Chet Ramey wrote: > > Close. What you call the `implicit' and `explicit' pipelines (subshells) > actually both inherit the trap strings, but not the actual signal > dispositions. Posix says this: > > "The trap command with no operands shall write to standard output a list > of

Re: EXIT trap in implicit vs. explicit pipeline subshell

2015-06-09 Thread Chet Ramey
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 6/7/15 12:55 PM, Miroslav Koskar wrote: > Bash Version: 4.3 > Patch Level: 39 > Release Status: release > > Description: > > For lack of better terminology I call subshell introduced by pipeline > as implicit when written like this: > >

EXIT trap in implicit vs. explicit pipeline subshell

2015-06-07 Thread Miroslav Koskar
Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-unknown-linux-gnu' -DCONF_VENDOR='unknown' -DLOCALEDIR='/usr/share/local