summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-10-30 18:36:27 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-10-30 18:36:27 +0200
commitb61b0eb5cc4db2e2929381f3db906a805c031802 (patch)
treed2b4eb06186e7810e8dab8a25831f4624ff90a97
parente7c32468983b372578f31fcea7a6c324527fb7c5 (diff)
Update bash style guide
-rw-r--r--doc/bash-style.cli8
1 files changed, 8 insertions, 0 deletions
diff --git a/doc/bash-style.cli b/doc/bash-style.cli
index 9d44374..09f802e 100644
--- a/doc/bash-style.cli
+++ b/doc/bash-style.cli
@@ -257,6 +257,14 @@ Instead always write:
cmd \"$@\"
\
+Also understand the difference between \c{@} and \c{*} expansion:
+
+\
+files=('one' '2 two' 'three')
+echo \"files: ${files[@]}\" # $1='files: one', $2='2 two', $3='three'
+echo \"files: ${files[*]}\" # $1='files: one 2 two three'
+\
+
\h1#trap|Trap|
Our scripts use the error trap to automatically terminate the script in case