title: How do you catch error codes in a shell pipe?
body: <p>I currently have a script that does something like</p>
  <pre class="lang-bash prettyprint-override"><code>./a | ./b | ./c
  </code></pre>
  <p>I want to modify it so that if any of <code>a</code>, <code>b</code>, or <code>c</code> exit with an error code I print an error message and stop instead of piping bad output forward.</p>
  <p>What would be the simplest/cleanest way to do so?</p>