The Bash shell scripts ignored errors in all but the last line.
This commit adds `set -eo pipefail` to fix the issue:
`set -e` causes the script to exit as soon as any command exits with a
non-zero exit code. When pipes are used, this flag only applies to the
last command in a pipe. The `set -o pipefail` option ensures that the
script is also exited with a non-zero exit code when any command in the
pipe fails.