[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bash-3.1.1: unable to feed "trap -p" output into a pipe
From: |
Chet Ramey |
Subject: |
Re: bash-3.1.1: unable to feed "trap -p" output into a pipe |
Date: |
Sat, 07 Jan 2006 16:43:48 -0500 |
User-agent: |
Thunderbird 1.5 (Macintosh/20051201) |
Dmitry V. Levin wrote:
> Hi,
>
> A "trap -p" output doesn't feed into a pipe:
> $ trap -p
>
> $ trap "echo ..." EXIT
>
> $ trap -p EXIT
>
> trap -- 'echo ...' EXIT
>
> $ trap -p EXIT |wc -l
>
> 0
>
Each element of a pipeline is run in a subshell. Subshells don't
traps from their parent.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet )
Live Strong.
Chet Ramey, ITS, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/