mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
Fix number of args
@@ -16,7 +16,7 @@ cp "$@" ~/dir
|
|||||||
|
|
||||||
Double quotes around `$@` (and similarly, `${array[@]}`) prevents globbing and word splitting of individual elements, while still expanding to multiple separate arguments.
|
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 four arguments: `baz`, `foo bar`, `*` and `/*/*/*/*`
|
||||||
|
|
||||||
`"$@"` will expand into exactly that: `baz`, `foo bar`, `*` and `/*/*/*/*`
|
`"$@"` will expand into exactly that: `baz`, `foo bar`, `*` and `/*/*/*/*`
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user