How to make a script, which will write a string signal caught after sending 'interrupt signal' (after pressing ^C on the console, where the script was executed). On top of that after pressing third time CTRL-C it will ask user, if it should end (yes/no). If answer is no it will end.
Script which reacts to interrupt signal
scripting