bug-bash
[Top][All Lists]
Advanced

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

pipefail with SIGPIPE/EPIPE


From: Pádraig Brady
Subject: pipefail with SIGPIPE/EPIPE
Date: Fri, 13 Feb 2015 17:19:42 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0

I was expecting bash to handle SIGPIPE specially here,
as in this context it's informational rather than an indication of error.
I.E. if a command to the right actually does fail
the status is set to that fail and the resulting SIGPIPEs
to the left are inconsequential to the status.
If no command fails, then the SIGPIPEs are informational,
and it seems they should also be inconsequential to the status.

  $ set -o pipefail
  $ yes | head -n1 || echo error
  y
  error

cheers,
Pádraig.



reply via email to

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