From dbb029cf95cd69ada9b16e09ba846778638cb8b2 Mon Sep 17 00:00:00 2001 From: Vidar Holen Date: Sat, 25 Jul 2020 17:44:48 -0700 Subject: [PATCH] Updated SC2068 (markdown) --- SC2068.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SC2068.md b/SC2068.md index 1b7ecc4..9ac6b58 100644 --- a/SC2068.md +++ b/SC2068.md @@ -16,11 +16,11 @@ cp "$@" ~/dir Double quotes around `$@` (and similarly, `${array[@]}`) prevents globbing and word splitting of individual elements, while still expanding to multiple separate arguments. -Let's say you have three arguments: `baz`, `foo bar` and `*` +Let's say you have three arguments: `baz`, `foo bar`, `*` and `/*/*/*/*` -`"$@"` will expand into exactly that: `baz`, `foo bar` and `*` +`"$@"` will expand into exactly that: `baz`, `foo bar`, `*` and `/*/*/*/*` -`$@` will expand into multiple other arguments: `baz`, `foo`, `bar`, `file.txt` and `otherfile.jpg` +`$@` will expand into multiple other arguments: `baz`, `foo`, `bar`, `file.txt`, `otherfile.jpg`, and (eventually) a list of most files on the system Since the latter is rarely expected or desired, ShellCheck warns about it.