0
votes
1answer
752 views

Trap ctrl-z key to perform cleanup

All, I have a shell script where I want to call a function to do some cleanup if user presses the ctrl-z key(SIGTSTP signal). I read about the trap command and found an example where I can trap the ...
1
vote
2answers
1k views

Background process and SIGHUP

My understanding is that a program that is associated with a BASH terminal will receive the SIGHUP signal if that terminal is closed. This usually will terminate the program. I also know that you ...
2
votes
1answer
458 views

Selectively ignoring Ctrl+C / SIGINT

I have the following bash compound command: while true ; do slow-command-one ; slow-command-two ; slow-command-three ; done What happens: When I press CtrlC at any point, the entire command is ...