Tag Archives: trap

How to Catch Ctrl-C in Shell Script

There are times when you do not want users to stop a running shell script abruptly by sending the Ctrl-C key combination. There is no way to prevent users from doing that, but there is a way to catch or trap Ctrl-C key combinations in a shell script.