This script does not echo "after":
#!/bin/bash -e echo "before" echo "anything" | grep e # it would if I searched for 'y' instead echo "after" exit
It also would if I removed the
-e option on the shebang line, but I wish to keep it so my script stops if there is an error. I do not consider grep finding no match as an error. How may I prevent it from exiting so abruptely?