test25.sh 202 B

123456789101112131415
  1. #! ./testshell
  2. traph ()
  3. {
  4. trap 2
  5. kill -2 $$
  6. echo 'Error, survived!'
  7. sleep 1
  8. echo 'Survived even longer.'
  9. }
  10. echo 'You should be able to end the script with just one SIGINT'
  11. trap traph 2
  12. ./hardguy