title: Ignoring Bash pipefail for error code 141
body: <p>Setting the bash <code>pipefail</code> option (via <code>set -o pipefail</code>) allows the script to fail if a non-zero error is caught where there is a non-zero error in any step of a pipe.</p>
  
  <p>However, we are running into <code>SIGPIPE</code> errors (error code 141), where data is written to a pipe that no longer exists.</p>
  
  <p>Is there a way to set bash to ignore <code>SIGPIPE</code> errors, or is there an approach to writing an error handler that will handle all error status codes but, say, 0 and 141?</p>
  
  <p>For instance, in Python, we can add:</p>
  
  <pre><code>signal.signal(signal.SIGPIPE, signal.SIG_DFL) 
  </code></pre>
  
  <p>to apply the default behavior to <code>SIGPIPE</code> errors: ignoring them (cf. <a href="http://coding.derkeiler.com/Archive/Python/comp.lang.python/2004-06/3823.html" rel="noreferrer">http://coding.derkeiler.com/Archive/Python/comp.lang.python/2004-06/3823.html</a>).</p>
  
  <p>Is there some similar option available in bash?</p>