Technology

Trapping ctrl+c in Bash scripts

If you happen to have some Bash scripts and would like to abort it in clean way there is way to do it. You need to trap ctrl+c command. In case you have some while loop in your scripts, without it, pressing any abort commands is only half way effective. Now, with ctrl+c trapped, you can cleanly abort your script without things still running.