quote-at-expansion
What it does
Section titled “What it does”Reports an unquoted $@ or ${array[@]} in the arguments of a command.
Why it matters
Section titled “Why it matters”Unquoted, each element is split again on blanks and globbed, so the arguments that were separate words are cut apart. Only "$@" keeps each argument as one word.
To fix, write "$@" or "${array[@]}".
Example
Section titled “Example”...diff <(sort a) <(sort b); echo <(date)...cp $@ dircp "$@" dir "${arr[@]}" ${arr[@]}...now=`date`...Configuration
Section titled “Configuration”shell: lint: rules: quote-at-expansion: error # off, warn, error (default)Enabled by the presets: shell/shellcheck.
Suppress one line with sudsy-disable-next-line quote-at-expansion in a comment of the file’s language.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools. full: Sudsy reports what the upstream rule reports; partial: only part of it, as the last column says.
| Tool | Rule | Match | What differs |
|---|---|---|---|
| shellcheck | SC2068 |
partial | Only the arguments of a command. |