I should have mentioned that
1. I am already using set -e
2. That `err` function has an `exit 1` as its last step,
which forces the program to stop running when combined with the first point.
> Now, on to your shell script example: in practice you'll never see an error because both grep and sed return true even when no matching or substitution is done.That's not what I'm seeing:
> echo "hi" | grep "bye"
> echo $?
1
I'm typing that into my shell.Thanks for the reply, it was very helpful.