Consistent use of longhand options

This commit is contained in:
Kevin van Zonneveld 2014-07-23 11:31:34 +02:00
parent 7304249545
commit e5af9cf01b

View File

@ -139,7 +139,7 @@ shift $((OPTIND-1))
# debug mode # debug mode
if [ "${arg_d}" = "1" ]; then if [ "${arg_d}" = "1" ]; then
set -x set -o xtrace
LOG_LEVEL="7" LOG_LEVEL="7"
fi fi
@ -162,7 +162,8 @@ fi
# Exit on error. Append ||true if you expect an error. # Exit on error. Append ||true if you expect an error.
# set -e is safer than #!/bin/bash -e because that is nutralised if # set -e is safer than #!/bin/bash -e because that is nutralised if
# someone runs your script like `bash yourscript.sh` # someone runs your script like `bash yourscript.sh`
set -e set -o errexit
set -o nounset
# Bash will remember & return the highest exitcode in a chain of pipes. # Bash will remember & return the highest exitcode in a chain of pipes.
# This way you can catch the error in case mysqldump fails in `mysqldump |gzip` # This way you can catch the error in case mysqldump fails in `mysqldump |gzip`