bug-bash
[Top][All Lists]
Advanced

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

Re: kill $! won't kill the last command in asynchronous list


From: Oğuz
Subject: Re: kill $! won't kill the last command in asynchronous list
Date: Wed, 1 Apr 2020 22:34:04 +0300

> You have to start the job with job control enabled if you want the
> background process to be its own process group leader, and at that point
> the shell started to run the group command will not have job control
> enabled and will run all processes in the same process group (its own),'
> so you could in theory use $!.
>
> If you start it from a shell with job control enabled, the bash running the
> -c command will be in its own process group and be the process group
> leader, and not have job control enabled.



> See above about job control shells. The -c command shell is not
> interactive, and will not have job control enabled by default, so all
> processes in that command will be in the same process group, so if you can
> figure out what it is, you should be fine. If you don't start that from a
> shell with job control enabled, the process group will be difficult to
> find, but $$ is your best bet and should work if you're starting it from
> a job control shell.
>

Yes, -m is exactly what I'm looking for. I should have read more about job
control and processes / process groups before posting the first mail.
Thanks for bearing with my ignorance


-- 
Oğuz


reply via email to

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