by tmcb · 3y ago · 0 comments
suspense_cleanup () {
echo "Suspense clean up..."
exit 0
}
int_cleanup () {
echo "Int clean up..."
exit 0
}
trap 'suspense_cleanup' SIGTSTP
trap 'int_cleanup' SIGINT
sleep 600 & waitAnyway, that works, thanks!
So it seems that trapping SIGTSTP works, so long as the script is currently executing an asynchronous command that is followed by a "wait", at the time when the user presses Ctrl-z. Did I get it right? I need to read a bit on this topic.