bash-2.05b$ trap -p bash-2.05b$ trap "echo ..." EXIT bash-2.05b$ trap -p EXIT trap -- 'echo ...' EXIT bash-2.05b$ trap -p EXIT |wc -l 0 bash-2.05b$
Same happens with bash-3.0
Same with bash-3.1.1.
From Chet Ramey answer: "Each element of a pipeline is run in a subshell. Subshells don't traps from their parent." http://lists.gnu.org/archive/html/bug-bash/2006-01/msg00019.html