From e5af9cf01bc36a95675513684a1d752b9c132827 Mon Sep 17 00:00:00 2001 From: Kevin van Zonneveld Date: Wed, 23 Jul 2014 11:31:34 +0200 Subject: [PATCH] Consistent use of longhand options --- main.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main.sh b/main.sh index 44b4534..4be3368 100755 --- a/main.sh +++ b/main.sh @@ -139,7 +139,7 @@ shift $((OPTIND-1)) # debug mode if [ "${arg_d}" = "1" ]; then - set -x + set -o xtrace LOG_LEVEL="7" fi @@ -162,7 +162,8 @@ fi # Exit on error. Append ||true if you expect an error. # set -e is safer than #!/bin/bash -e because that is nutralised if # 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. # This way you can catch the error in case mysqldump fails in `mysqldump |gzip`