1
I have a Linux application, written in C++, which traps the SIGINT interrupt in order to do some final cleanup before exiting. I call this application within a bash script. Now, when I type control-C with the bash script running in the foreground, the script terminates as does the program it invoked but without running the final cleanup code. How can I have the interrupt pass through the bash script, directly to the application, resulting in the final cleanup and then a normal exit which then causes the script itself to exit?