help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-bash] Inconsistent results of `trap '' EXIT`


From: Peng Yu
Subject: [Help-bash] Inconsistent results of `trap '' EXIT`
Date: Tue, 20 Feb 2018 09:02:43 -0600

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

-- 
Regards,
Peng



reply via email to

[Prev in Thread] Current Thread [Next in Thread]