mirror of
https://github.com/kvz/bash3boilerplate.git
synced 2024-12-20 07:07:51 +00:00
Consistent use of longhand options
This commit is contained in:
parent
7304249545
commit
e5af9cf01b
5
main.sh
5
main.sh
@ -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`
|
||||||
|
Loading…
Reference in New Issue
Block a user