-
Notifications
You must be signed in to change notification settings - Fork 1.8k
SC2121
Vidar Holen edited this page Jan 21, 2015
·
4 revisions
set var=42
set var 42
var=42
set
is not used to set or assign variables in Bourne shells. It's used to set shell options and positional parameters.
To assign variables, use var=value
with no set
or other qualifiers.
If you actually do want to set positional parameters, simply quoting them or using --
will make shellcheck stop warning, e.g. set -- var1 var2
or set "foo=bar"
.