test20b.sh 238 B

123456789101112131415161718192021
  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. trap traph 2
  11. #echo called is pid $$
  12. echo 'You should be able to kill this script with just one SIGINT'
  13. cat
  14. cat
  15. cat
  16. cat
  17. cat