We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 41a342d commit 8f28b76Copy full SHA for 8f28b76
content/articles/bash/script-template.md
@@ -22,8 +22,13 @@ set -u
22
# Fail if any command in a pipeline fails (not just the last one)
23
set -o pipefail
24
25
+# Enable for debugging
26
+#set -x
27
+#PS4='+ ${BASH_SOURCE}:${LINENO}: '
28
# Print line at which the script failed, if it failed (due to "set -e").
-trap 'print_error "Script failed at line $LINENO"' ERR
29
+# NOTE: There are a lot of issues when using $(...) with traps (i.e. they don't work as
30
+# expected). That's why this isn't enabled by default.
31
+#trap 'print_error "Script failed at line $LINENO"' ERR
32
33
# Configuration
34
SCRIPT_NAME="$(basename "$0")"
0 commit comments