Considering a scenario where a Parent program (could be a C++ program or a Shell Script) executes a Child shell script, when we hit Control+C (or whatever character is configured to be the INTR character) while the Child Shell Script is executing, a SIGINT is sent to all processes in the foreground process group. This includes the parent process.

Source : [POSIX.1-2008 XBD section 11.1.9][1]


Is there a way to override this default behavior? That the CHILD Process alone handles the SIGNAL without it propagating to the parent?


Reference : [Stack Overflow Post - Parent Process not Completing when Child is Interrupted (TRAP INT)][2]


 [1]: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap11.html#tag_11_01_09
 [2]: https://stackoverflow.com/questions/17357377/korn-shell-script-parent-process-not-completing-when-child-is-interrupted-tra