git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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 -1
Paul 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
Previous: Paul JacksonNext: Linus Torvalds
Message 10 of 22 in “How to get bash to shut up about SIGPIPE?”
  1. Linus TorvaldsApr 28, 2005
  2. Rene ScharfeApr 28, 2005
  3. Linus TorvaldsApr 28, 2005
  4. Rene ScharfeApr 28, 2005
  5. Ryan AndersonApr 28, 2005
  6. Linus TorvaldsApr 28, 2005
  7. Herbert XuMay 1, 2005
  8. David A. WheelerMay 1, 2005
  9. Paul JacksonMay 2, 2005
  10. David A. WheelerMay 4, 2005
  11. Linus TorvaldsMay 4, 2005
  12. Herbert XuMay 4, 2005
  13. Edgar ToernigApr 28, 2005
  14. Linus TorvaldsApr 28, 2005
  15. Joshua T. CorbinApr 29, 2005
  16. Paul JacksonApr 30, 2005
  17. Linus TorvaldsApr 30, 2005
  18. Paul JacksonApr 30, 2005
  19. Rene ScharfeApr 30, 2005
  20. Paul JacksonMay 2, 2005
  21. Petr BaudisMay 2, 2005
  22. Paul JacksonMay 3, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.