title: piping output through sed but retain exit status
body: <p>I pipe the output of a long-running build process through sed for syntax-highlighting, implemented as a wrapper around "mvn".</p>
  
  <p>Further I have a "monitor" script that notifies me on the desktop when the build is finished. The monitor script checks the exit state of its argument and reports "Success" or "Failure".</p>
  
  <p>By piping the maven output through sed, the exit status is always "ok", even when the build fails.</p>
  
  <p>How can I pipe the correct exit status through sed as well?</p>
  
  <p>Are there alternatives ?</p>