I have a pipeline which looks something like below, its written in bash
Trimmomatic --> Samtools --> Smalt --> Lastz --> custom perl programs.
If anyone of those processes fails they usually return a non-0 exit code, usually a
However, my pipeline program will continue to run, report the error and return an exit code of 0, indicating success.
How can I get the pipeline to quit/stop with a non-0 exit code when a part of the pipeline fails?