bash: Signals

1 
1 3.7.6 Signals
1 -------------
1 
1 When Bash is interactive, in the absence of any traps, it ignores
1 'SIGTERM' (so that 'kill 0' does not kill an interactive shell), and
1 'SIGINT' is caught and handled (so that the 'wait' builtin is
1 interruptible).  When Bash receives a 'SIGINT', it breaks out of any
1 executing loops.  In all cases, Bash ignores 'SIGQUIT'.  If job control
1 is in effect (⇒Job Control), Bash ignores 'SIGTTIN', 'SIGTTOU',
1 and 'SIGTSTP'.
1 
1    Non-builtin commands started by Bash have signal handlers set to the
1 values inherited by the shell from its parent.  When job control is not
1 in effect, asynchronous commands ignore 'SIGINT' and 'SIGQUIT' in
1 addition to these inherited handlers.  Commands run as a result of
1 command substitution ignore the keyboard-generated job control signals
1 'SIGTTIN', 'SIGTTOU', and 'SIGTSTP'.
1 
1    The shell exits by default upon receipt of a 'SIGHUP'.  Before
1 exiting, an interactive shell resends the 'SIGHUP' to all jobs, running
1 or stopped.  Stopped jobs are sent 'SIGCONT' to ensure that they receive
1 the 'SIGHUP'.  To prevent the shell from sending the 'SIGHUP' signal to
1 a particular job, it should be removed from the jobs table with the
1 'disown' builtin (⇒Job Control Builtins) or marked to not receive
1 'SIGHUP' using 'disown -h'.
1 
11    If the 'huponexit' shell option has been set with 'shopt' (⇒The
 Shopt Builtin), Bash sends a 'SIGHUP' to all jobs when an interactive
1 login shell exits.
1 
1    If Bash is waiting for a command to complete and receives a signal
1 for which a trap has been set, the trap will not be executed until the
1 command completes.  When Bash is waiting for an asynchronous command via
1 the 'wait' builtin, the reception of a signal for which a trap has been
1 set will cause the 'wait' builtin to return immediately with an exit
1 status greater than 128, immediately after which the trap is executed.
1