Re: How to get bash to shut up about SIGPIPE?
- From
David A. Wheeler <dwheeler@dwheeler.com>
- Date
- May 4, 2005, 02:30 UTC
- Message-ID
- <427833AE.6030505@dwheeler.com>
- In-Reply-To
- <20050502091027.6753998e.pj@sgi.com>
I reported:
>>One approach is to install a trap for SIGPIPE in
>>non-terminating command in a pipeline where the
>>later items might not process all the data, e.g.:
>> (trap {} SIGPIPE; find .) | head -1Paul Jackson wrote:
> Both the versions of bash that I looked at (2.05 and 3.0) _still_ > complain even if SIGPIPE is trapped - they just complain with > a more terse message, unless DONT_REPORT_SIGPIPE is not defined.
...
> What bash do you have that this trap silences?
Actually, I have a working bash, so I can't test any of these work-arounds. I was merely foolish enough to quote the Debian discussion, where someone reported that as a work-around. I had hopes that it would help. That'll teach me to pay attention to documentation :-).
I wonder, does a top-level trap work? E.g.: trap "" SIGPIPE ...
Anyone, good luck to those with broken bashes...
--- David A. Wheeler