Denys Vlasenko | c91950f | 2020-02-19 12:10:41 +0100 | [diff] [blame] | 1 | # "exit" in trap should not use last command's exitcode, |
2 | # but exitcode on entering the trap. | ||||
3 | $THIS_SH -c ' | ||||
4 | trap "false;exit" term | ||||
5 | kill $$ & | ||||
Denys Vlasenko | 9aa751b | 2020-02-26 09:05:52 +0100 | [diff] [blame] | 6 | (sleep 1; exit 42) |
Denys Vlasenko | c91950f | 2020-02-19 12:10:41 +0100 | [diff] [blame] | 7 | ' |
8 | echo 42:$? |