3
0

subshell.tests 580 B

12345678910111213141516171819
  1. # Non-empty traps should be reset in subshell
  2. # HUP is special in interactive shells
  3. trap '' HUP
  4. # QUIT is always special
  5. trap '' QUIT
  6. # SYS is not special
  7. trap '' SYS
  8. # WINCH is harmless
  9. trap 'bad: caught WINCH' WINCH
  10. # With TERM we'll check whether it is reset
  11. trap 'bad: caught TERM' TERM
  12. (trap; "$THIS_SH" -c 'kill -HUP $PPID'; echo Ok)
  13. (trap; "$THIS_SH" -c 'kill -QUIT $PPID'; echo Ok)
  14. (trap; "$THIS_SH" -c 'kill -SYS $PPID'; echo Ok)
  15. (trap; "$THIS_SH" -c 'kill -WINCH $PPID'; echo Ok)
  16. (trap; "$THIS_SH" -c 'kill -TERM $PPID'; echo Bad: TERM is not reset)
  17. echo Done