2020-02-19 12:10:41 +01:00
|
|
|
# "exit" in trap should not use last command's exitcode,
|
|
|
|
# but exitcode on entering the trap.
|
|
|
|
$THIS_SH -c '
|
|
|
|
trap "false;exit" term
|
|
|
|
kill $$ &
|
2020-02-26 09:05:52 +01:00
|
|
|
(sleep 1; exit 42)
|
2020-02-19 12:10:41 +01:00
|
|
|
'
|
|
|
|
echo 42:$?
|