Ask HN: How to trap SIGTSTP (ctrl-z) in a Bash script?

  • 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