blob: 59a07fc912bb4e8cad8eaad29e1f3e059d6f1dd7 [file] [log] [blame]
Denys Vlasenko3ced8042020-02-21 02:55:53 +01001# "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 $$ &
Denys Vlasenko9aa751b2020-02-26 09:05:52 +01008 (sleep 1; exit 42)
Denys Vlasenko3ced8042020-02-21 02:55:53 +01009'
10echo 42:$?