[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-bash] Can a child script know the pid parent script of the progres
[Help-bash] Can a child script know the pid parent script of the progress id?
Fri, 29 May 2015 09:03:45 -0500
Is there a way for the child script to know which process group it
belongs to? Thanks.
On Fri, May 29, 2015 at 7:08 AM, Greg Wooledge <address@hidden> wrote:
> On Fri, May 29, 2015 at 12:23:24AM -0500, Peng Yu wrote:
>> The following shows that SIGINT is propagated to ./script.sh.
> Are you talking about keyboard-generated signals (Ctrl-C), or signals
> sent to a single process via the kill command?
> If you run a script from a terminal, in the foreground, and that script
> runs some other program synchronously (in the foreground), and you press
> Ctrl-C on your keyboard while focused on that terminal, the SIGINT will be
> sent to EVERY foreground process. This is not "propagation". It is not
> one process receiving the signal and passing it along to its children.
> Processes do not do that. If you wanted that, you would have to code
> it yourself.
> Keyboard-generated signals are sent by the terminal driver to every
> foreground process at once.
- [Help-bash] Can a child script know the pid parent script of the progress id?,
Peng Yu <=