3
0

exitcode_trap6.tests 250 B

12345678910
  1. # "exit" in trap should not use last command's exitcode,
  2. # but exitcode on entering the trap.
  3. # Nested trap should not interfere with this.
  4. $THIS_SH -c '
  5. trap "echo INT" int
  6. trap "kill -int $$;exit" term
  7. kill $$ &
  8. (sleep 1; exit 42)
  9. '
  10. echo 42:$?