Peng Yu
2018-02-20 15:02:43 UTC
The following code shows that `trap '' EXIT` has a different effect
that depends on whether it has been set before. It is better to make
`trap '' EXIT` reset the signal instead of using `trap - EXIT`?
$ trap -p EXIT
$ trap 'echo abc' EXIT
$ trap -p EXIT
trap -- 'echo abc' EXIT
$ trap '' EXIT
$ trap -p EXIT
trap -- '' EXIT
that depends on whether it has been set before. It is better to make
`trap '' EXIT` reset the signal instead of using `trap - EXIT`?
$ trap -p EXIT
$ trap 'echo abc' EXIT
$ trap -p EXIT
trap -- 'echo abc' EXIT
$ trap '' EXIT
$ trap -p EXIT
trap -- '' EXIT
--
Regards,
Peng
Regards,
Peng