Skip to content

quote-star-expansion

Shellsuspiciousno fixdefault: warnshell/shellcheck

Reports an unquoted $* or ${array[*]} in the arguments of a command.

Unquoted, it is split on blanks and globbed, and an argument that held a space becomes two. $* is rarely what is wanted.

To fix, write "$@", or "$*" if one string is meant.

Reported
...
cp $* dir ${arr[*]}
now=`date`
...
shell:
lint:
rules:
quote-star-expansion: warn # off, warn (default), error

Enabled by the presets: shell/shellcheck.

Suppress one line with sudsy-disable-next-line quote-star-expansion in a comment of the file’s language.

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 SC2048 partial Only the arguments of a command.