Re: Kill sends signal to wrong process group with job control enabled
From:
Ben Ashton
Subject:
Re: Kill sends signal to wrong process group with job control enabled
Date:
Mon, 2 Mar 2026 02:32:32 -0800
User-agent:
Mozilla Thunderbird
On 01/03/2026 22:18, Oğuz wrote:
On Monday, March 2, 2026, Ben Ashton <ben@n0m.org <mailto:ben@n0m.org>>
wrote:
As you can see, bash is the only one that translates $! to the PGID
of the subshell.
I don't think that is what's going on here. It looks more like bash
turns off job control in the subshell and includes `setsid sleep 5 &' in
the subshell's process group, which makes sense.
--
Oğuz
That IS what's going on. Setsid makes sleep the leader of a new process
group.