[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Does Bash 5.1 block SIGINT until here-document is ready?
From: |
Oğuz |
Subject: |
Re: Does Bash 5.1 block SIGINT until here-document is ready? |
Date: |
Sun, 13 Dec 2020 20:39:46 +0300 |
I ran that command on both bash 4.4 and 5.1, and checked PGIDs using
pstree; results were parallel:
$ pstree -pg 3255 # 4.4
bash(3255,3255)───bash(3296,3296)───sleep(3297,3255)
$ pstree -pg 3299 # 5.1
bash(3299,3299)───bash(3305,3305)───sleep(3306,3299)
Are you sure a misplacement of the child is the issue here? Or am I missing
something?
Oğuz
On Sat, Dec 12, 2020 at 10:16 PM Chet Ramey <chet.ramey@case.edu> wrote:
> On 12/12/20 5:54 AM, Oğuz wrote:
> > In Bash 5.1, Ctrl-C doesn't interrupt the command below. The only way
> out I
> > guess is to stop it Ctrl-Z and run `kill %%`, but that's really too much
> > work.
> >
> > cat <<!
> > `sleep 10`
> > !
> >
> > This isn't reproducible with Bash 5.0 or Bash 4.4.
>
> It's not a signal blocking problem. It's a combination of an interactive
> shell and the shell forked to run the command substitution inside the shell
> forked to run `cat', which is running the redirection. The issue is that
> the child running the command subsitition is not placed into the correct
> process group, so its process group is not the same as the terminal's. It
> should join its parent's process group.
>
> Chet
> --
> ``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/
>