Signal handling
The SIGINT and SIGQUIT signals
for an invoked command are ignored if the command is followed by an ampersand
(&
) and the job monitor option is not active.
Otherwise, signals have the values that the shell inherits from its parent.
When a signal for which a trap has been set is received while the shell is waiting for the completion of a foreground command, the trap associated with that signal will not be executed until after the foreground command has completed. Therefore, a trap on a CHILD signal is not performed until the foreground job terminates.