mirror of
https://github.com/kvz/bash3boilerplate.git
synced 2024-12-20 23:13:07 +00:00
Comment each set with a single line
This commit is contained in:
parent
008face7c8
commit
e0aadaf50c
10
main.sh
10
main.sh
@ -11,17 +11,15 @@
|
|||||||
# Copyright (c) 2013 Kevin van Zonneveld and contributors
|
# Copyright (c) 2013 Kevin van Zonneveld and contributors
|
||||||
# http://bash3boilerplate.sh/#authors
|
# http://bash3boilerplate.sh/#authors
|
||||||
|
|
||||||
# Exit on error. Append ||true if you expect an error.
|
# Exit on error. Append || true if you expect an error.
|
||||||
# `set` is safer than relying on a shebang like `#!/bin/bash -e` because that is neutralized
|
|
||||||
# when someone runs your script as `bash yourscript.sh`
|
|
||||||
set -o errexit
|
set -o errexit
|
||||||
# Exit on error inside any functions or subshells.
|
# Exit on error inside any functions or subshells.
|
||||||
set -o errtrace
|
set -o errtrace
|
||||||
|
# Do not allow use of undefined vars. Use ${VAR:-} to use an undefined VAR
|
||||||
set -o nounset
|
set -o nounset
|
||||||
|
# Catch the error in case mysqldump fails (but gzip succeeds) in `mysqldump |gzip`
|
||||||
# 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`
|
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
# Turn on traces, useful while debugging but commented out by default
|
||||||
# set -o xtrace
|
# set -o xtrace
|
||||||
|
|
||||||
# Environment variables and their defaults
|
# Environment variables and their defaults
|
||||||
|
Loading…
Reference in New Issue
Block a user