All you need to do is set -e at the start of the script to stop on a non-0 exit code. And quote variables to prevent globbing.
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
replies:
All you need to do is set -e at the start of the script to stop on a non-0 exit code. And quote variables to prevent globbing.