When running a script with some lines not too important for the script to finish, how do I cancel a specific command without killing the entire script?
Normally I would invoke Ctrl+c, but when I do that with that script, the entire script ends prematurely. Is there a way (e.g. options placed inside the script) to allow Ctrl+c just for the command at hand?
A bit of a background:
I have my
~/.bash_profile to run
ssh-add as part of it, but if I cancel it, I would like to get the echo lines following the "error 130" of
ssh-add being shown to remind me to run it manually before any connection.