bug-bash
[Top][All Lists]
Advanced

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

cannot pipe output of trap


From: proway . imbusch
Subject: cannot pipe output of trap
Date: Wed, 23 Jul 2008 10:54:29 +0200

From: oimbusc
To: address@hidden
Subject: cannot pipe output of trap

Configuration Information [Automatically generated, do not change]:
Machine: i686
OS: cygwin
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash.exe' -DCONF_HOSTTYPE='i686' 
-DCONF_OSTYPE='cygwin' -DCONF_MACHTYPE='i686-pc-cygwin' -DCONF_VENDOR='pc' 
-DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H 
-DRECYCLES_PIDS   -I.  -I/home/eblake/bash-3.2.39-19/src/bash-3.2 
-I/home/eblake/bash-3.2.39-19/src/bash-3.2/include 
-I/home/eblake/bash-3.2.39-19/src/bash-3.2/lib   -O2 -pipe 
uname output: CYGWIN_NT-5.1 CSTRD00000A07HE 1.5.25(0.156/4/2) 2008-06-12 
19:34 i686 Cygwin
Machine Type: i686-pc-cygwin

Bash Version: 3.2
Patch Level: 39
Release Status: release

Description:
        After registering trap handlers, 'trap | cat' does not deliver any
        output ('trap' does).

Repeat-By:
        #!/usr/bin/bash

        allSignalNames () {
            trap -l | tr '\t' '\n' | awk '{ print $2; }' | sed 's/^SIG//g' 
| echo `cat`
        }

        log () {
            echo >&2 "$@"
        }

        log "BASH_VERSION: $BASH_VERSION"

        for signal in EXIT `allSignalNames`; do
            trap "echo \"trapped: $signal\"" $signal
        done

        log "<<< trap"
        trap
        log ">>> trap"

        log "<<< trap | cat"
        trap | cat
        log ">>> trap | cat"

        trapOut="/tmp/trap"
        log "<<< trap > $trapOut; cat $trapOut"
        trap > "$trapOut"
        cat    "$trapOut"
        log ">>> trap > $trapOut; cat $trapOut"

If you are not the intended addressee, please inform us immediately that you 
have received this e-mail in error, and delete it. We thank you for your 
cooperation.  

reply via email to

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