Quick summary: parent and child in a loop, each can either trap or not trap signals. I don't understand why, if the child traps and the parent doesn't, the parent is not terminated.The detail:I have two simple scripts, which just run a loop, and optionally trap SIGINT and other signals. The child script is launched by the parent.Parent:#!/bin/bashparent_trap=$1child_trap=$2shutdown=0(( parent_trap )) && trap echo 'parent: caught signal'; shutdown=1 INT TERM HUP PIPEwhile (( ! shutdown )) ; do    echo parent    ./child $child_trap    sleep 1doneChild:#!/bin/bashchild_trap=$1shutdown=0(( child_trap )) && trap echo 'child: caught signal'; shutdown=1 INT TERM HUP PIPEwhile (( ! shutdown )) ; do    echo child    sleep 1doneWhen these are run with the four combinations of trapping signals:no trapping:$ ./parent 0 0parentchildchildchild^Cparent and child are both terminated by ctrl-c. As I understand it, the shell sends SIGINT to all processes in the process group, there are no handlers, so the default action of terminate is invoked.parent and child both trap:$ ./parent 1 1parentchildchildchild^Cchild: caught signalparent: caught signalparent and child both catch signal and both exit cleanlyparent traps signal, child does not:$ ./parent 1 0parentchildchildchild^Cparent: caught signalparent catches signal and exits cleanly. child is killed by terminate (I think)child traps signal, parent does not:$ ./parent 0 1parentchildchildchild^Cchild: caught signalparentchild^Cchild: caught signalparentchild^Cchild: caught signal^Cchild traps signal and exits cleanly, but parent, which does not trap signal continues (relaunching child) until ctrl-c is pressed twice in quick succession.Why isn't the parent terminated as the default action when there is no signal handler?
bash parent and child signal handling
bash;trap