|
From: | Chet Ramey |
Subject: | Re: why are pipeline commands (allowed to be) executed in subshells? |
Date: | Thu, 22 Dec 2022 17:02:18 -0500 |
User-agent: | Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 |
On 12/21/22 5:46 PM, Philippe Cerfon wrote:
Hey Chet. On Wed, Dec 21, 2022 at 4:20 PM Chet Ramey <chet.ramey@case.edu> wrote:When the shell is running a loop and a child process dies due to SIGINT, the shell pretends it got the SIGINT to break the loop. This reduces user surprise and frustration.Ah, and I guess it learns about the process being killed by an INT via the CHLD. Is this somewhere documented? Because I've had read in the "Signals" section of the manpage and from there I wouldn't have deduced this.
No, it's how people expect things to work. It looks like I made that change (break loop when SIGINT trapped) back in May, 2015 from a bug report in January, 2015. This was to make it have the same loop-breaking behavior as when SIGINT was not trapped, which had been in bash since bash-2.0 (release frozen exactly 26 years ago today), so it's been that way for years. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRU chet@case.edu http://tiswww.cwru.edu/~chet/
[Prev in Thread] | Current Thread | [Next in Thread] |