I have a bash script with -e option set, which fails the whole script on the very first error.
-e
In the script, I am trying to do an ls on a
ls
Another option is to use trap to catch the EXIT signal:
trap
EXIT
trap 'echo "ls failed" ; some_rescue_action' EXIT ls /non_exist