Page 1 of 1

Catch Ctrl+C (Interrupted Signal)

Posted: Thu Aug 20, 2015 6:57 am
by Tal
Is there any way to catch a Ctrl+C and clean up before exiting a script?

I tried:
do { :delay 2 } on-error={ :put "Test" }
But that didn't work - when you interrupt the command with Ctrl+C while it's running, there is no output.
Any proper way to do it?

Re: Catch Ctrl+C (Interrupted Signal)

Posted: Thu Aug 20, 2015 1:19 pm
by mrz
You can't because ctrl-c is interactive.