Hacker News new | ask | show | jobs
by tmcb 1068 days ago
You are probably looking for help at the wrong website---anyway, just let me know if that helps.

    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 & wait
1 comments

Yes sorry, I just wanted to come to a place with some experts. I tried some other popular sites with little luck.

Anyway, 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.