From b61b0eb5cc4db2e2929381f3db906a805c031802 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 30 Oct 2017 18:36:27 +0200 Subject: Update bash style guide --- doc/bash-style.cli | 8 ++++++++ 1 file changed, 8 insertions(+) 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 -- cgit v1.1