catch.tests 286 B

1234567891011121314151617181920
  1. # avoid ugly warnings about signals not being caught
  2. trap ":" USR1 USR2
  3. "$THIS_SH" -c '
  4. trap "echo caught" USR2
  5. echo "sending USR2"
  6. kill -USR2 $$
  7. trap "" USR2
  8. echo "sending USR2"
  9. kill -USR2 $$
  10. trap "-" USR2
  11. echo "sending USR2"
  12. kill -USR2 $$
  13. echo "not reached"
  14. '
  15. trap "-" USR1 USR2