Stop bash script if error

To stop a bash script if you get an error during its execution, you can call the command :

set -e

Or

bash -e scriptname.sh

Or

set +e