help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: why are pipeline commands (allowed to be) executed in subshells?


From: Philippe Cerfon
Subject: Re: why are pipeline commands (allowed to be) executed in subshells?
Date: Tue, 13 Dec 2022 13:45:12 +0100

On Tue, Dec 13, 2022 at 4:49 AM Greg Wooledge <greg@wooledge.org> wrote:
> The "wait" command is a builtin, and it's explicltly allowed to be
> interrupted by a trapped signal.

Yes, had found that out myself shortly after writing :-)

> > In the example given in my previous mail (without the wait) the shell
> > did not pass on the HUP signal to forground sleep (where it was
> > waiting), so its HUP trap neither got executed.
>
> The shell NEVER "passes on" the signal to its child processes.

> In this example, I didn't include a trap.  But doing so makes no
> difference in this case.  Go ahead and try it both ways, and you'll see
> the same behavior.

Well that's clear now for the case with wait... and I also understand
the one without wait and with HUP as signal.

But as written in two mails before, INT seems to be "passed on"
immediately to the child sleep (which runs in the foreground there).


Thanks,
Philippe



reply via email to

[Prev in Thread] Current Thread [Next in Thread]