[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: SIGPIPE not properly reset with 'trap - PIPE'
From: |
Andreas Schwab |
Subject: |
Re: SIGPIPE not properly reset with 'trap - PIPE' |
Date: |
Thu, 11 Dec 2008 10:13:18 +0100 |
User-agent: |
Gnus/5.110009 (No Gnus v0.9) Emacs/22.3 (gnu/linux) |
Ralf Wildenhues <Ralf.Wildenhues@gmx.de> writes:
> I noticed the following bash bug when using gnulib-tool. The script
> below outputs
>
> foo: line 20: echo: write error: Broken pipe
> foo: line 21: echo: write error: Broken pipe
>
> with bash 3.2.48(5)-release on GNU/Linux, whereas I think it should be
> silent. Please note that the script assumes that GNU coreutils seq is
> installed.
>
> Please also note that the above errors occur also when
> trap '' PIPE
>
> is used instead of 'trap - PIPE'.
You probably have SIGPIPE ignored when you start the script. From
POSIX:
Signals that were ignored on entry to a non-interactive shell cannot
be trapped or reset, although no error need be reported when
attempting to do so.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."