summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2021-01-14 09:50:01 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2021-01-14 09:50:01 +0200
commit510cff62060da3ed639bed663ffb85311bf23707 (patch)
tree98486d0c43a36417c11ff6bab8a1a6bef17e46ab /doc
parent0736fbf811a47ed057bf4196b158a0e9829bd416 (diff)
Add nullglob recommendation to Bash style guide
Diffstat (limited to 'doc')
-rw-r--r--doc/bash-style.cli5
1 files changed, 3 insertions, 2 deletions
diff --git a/doc/bash-style.cli b/doc/bash-style.cli
index c3e79d4..217ad11 100644
--- a/doc/bash-style.cli
+++ b/doc/bash-style.cli
@@ -90,6 +90,7 @@ trap \"{ cd '$owd'; exit 1; }\" ERR
set -o errtrace # Trap in functions and subshells.
set -o pipefail # Fail if any pipeline command fails.
shopt -s lastpipe # Execute last pipeline command in the current shell.
+shopt -s nullglob # Expand no-match globs to nothing rather than themselves.
function info () { echo \"$*\" 1>&2; }
function error () { info \"$*\"; exit 1; }
@@ -231,8 +232,8 @@ option=--quiet # Option name.
seds='s%^./%%' # sed script.
\
-Note that quoting will inhibit globbing so you may end up with expansions
-along these lines:
+Take care to quote globs that are not meant to be expanded. And since quoting
+will inhibit globbing, you may end up with expansions along these lines:
\
rm -f \"$dir/$name\".*