This question already has answers here:
Closed 6 years ago.
Here's an example of what I'm trying to achieve:
#!/bin/bash
set -e # abort if error
...
command1 2>&1 | command2
...
And I notice that sometimes command1
fails but command2 does not and the shell script happily continues...
if I did not have to use the pipe here, the set -e
would have been sufficient but now it does not work with the pipe there...
Any thoughts? Thanks