Bug 7610

Summary: Unable to feed "trap -p" output into a pipe
Product: Sisyphus Reporter: at <at>
Component: bashAssignee: placeholder <placeholder>
Status: CLOSED NOTABUG QA Contact: qa-sisyphus
Severity: normal    
Priority: P2 CC: glebfm, ldv, placeholder
Version: unstable   
Hardware: all   
OS: Linux   
URL: http://lists.gnu.org/archive/html/bug-bash/2006-01/msg00019.html

Description at@altlinux.org 2005-08-09 03:33:33 MSD
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$
Comment 1 Dmitry V. Levin 2005-12-31 02:21:47 MSK
Same happens with bash-3.0
Comment 2 Dmitry V. Levin 2006-01-07 01:14:29 MSK
Same with bash-3.1.1.
Comment 3 Dmitry V. Levin 2006-01-10 01:45:31 MSK
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