receiving SIGHCHLD if job control is disabled - expected behavior?

2021-10-01 Thread Vladimir Marek
Hello, The code in question is set +m echo $BASH_VERSION echo $SHELLOPTS trap 'echo =SIGCHLD=' 18 sleep 1 echo done Bash 5 output: 5.0.17(1)-release braceexpand:hashall:interactive-comments =SIGCHLD= done Bash 4 output: 4.4.19(1)-release braceexpand:hashall:interactive-comment

Re: receiving SIGHCHLD if job control is disabled - expected behavior?

2021-10-01 Thread Chet Ramey
On 10/1/21 4:24 AM, Vladimir Marek wrote: Hello, The code in question is set +m echo $BASH_VERSION echo $SHELLOPTS trap 'echo =SIGCHLD=' 18 sleep 1 echo done Bash 5 output: 5.0.17(1)-release braceexpand:hashall:interactive-comments =SIGCHLD= done Bash 4 output: 4.4.19(1)-rel

Re: EXIT trap is not executed after an exec failure in a non-interactive shell

2021-10-01 Thread Chet Ramey
On 9/30/21 7:24 PM, Mark March wrote: If execfail is set, a failed exec does not cause a non-interactive shell to exit, but it seems to reset the EXIT trap: Yes. When the shell runs `exec', it assumes the execed program will overlay the shell process. To make that happen transparently, it has

Re: [External] : Re: receiving SIGHCHLD if job control is disabled - expected behavior?

2021-10-01 Thread Vladimir Marek
On Fri, Oct 01, 2021 at 09:39:50AM -0400, Chet Ramey wrote: > On 10/1/21 4:24 AM, Vladimir Marek wrote: > > Hello, > > > > The code in question is > > > > set +m > > echo $BASH_VERSION > > echo $SHELLOPTS > > trap 'echo =SIGCHLD=' 18 > > sleep 1 > > echo done > > > > > > Bash 5 output:

Re: EXIT trap is not executed after an exec failure in a non-interactive shell

2021-10-01 Thread Robert Elz
Date:Fri, 1 Oct 2021 09:59:44 -0400 From:Chet Ramey Message-ID: | Yes. When the shell runs `exec', it assumes the execed program will overlay | the shell process. To make that happen transparently, it has to undo things | it has done: it ends job control and re

Re: EXIT trap is not executed after an exec failure in a non-interactive shell

2021-10-01 Thread Mark March
Ok, thank you for clarifying. There is nothing in the documentation about this behavior as far as I can tell. I would suggest adding a line about traps getting reset after a failed exec to the paragraph on 'execfail'. -Mark On Friday, October 1, 2021, 07:02:34 AM PDT, Chet Ramey wrote: