help-bash
[Top][All Lists]
Advanced

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

Re: [Help-bash] How to forbidden SIGINT be propagated from the parent sc


From: Greg Wooledge
Subject: Re: [Help-bash] How to forbidden SIGINT be propagated from the parent script to the child script?
Date: Fri, 29 May 2015 08:08:57 -0400
User-agent: Mutt/1.4.2.3i

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.



reply via email to

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