Denys Vlasenko | bb095f4 | 2020-02-20 16:37:59 +0100 | [diff] [blame] | 1 | # "return" in trap should not use last command's exitcode, |
2 | # but exitcode on entering the trap. | ||||
3 | trap "echo TERM;return" term | ||||
4 | f() { | ||||
5 | (sleep 1; kill $$) & | ||||
6 | until (exit 42) do (exit 42); done | ||||
7 | } | ||||
8 | f | ||||
9 | echo 42:$? |