Bug 7610 - Unable to feed "trap -p" output into a pipe
Summary: Unable to feed "trap -p" output into a pipe
Status: CLOSED NOTABUG
Alias: None
Product: Sisyphus
Classification: Development
Component: bash (show other bugs)
Version: unstable
Hardware: all Linux
: P2 normal
Assignee: placeholder@altlinux.org
QA Contact: qa-sisyphus
URL: http://lists.gnu.org/archive/html/bug...
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-09 03:33 MSD by at@altlinux.org
Modified: 2006-01-10 01:45 MSK (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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