I pipe the output of a long-running build process through sed for syntax-highlighting, implemented as a wrapper around “mvn”.
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”.
By piping the maven output through sed, the exit status is always “ok”, even when the build fails.
How can I pipe the correct exit status through sed as well?
Are there alternatives ?
A week later I got a solution:
Originally I wwanted to do
where monitor would reacts on exit status of sed (instead of mvn).
It’s easier to do
Note that this pipes the output of monitor through sed, while the monitor script reacts on status of mvn.
Thanks anyway for the other ideas.