-
Notifications
You must be signed in to change notification settings - Fork 1.8k
SC2283
Joachim Ansorg edited this page Nov 12, 2021
·
2 revisions
# Assignment
var = value
# Comparison
if $var = value
then
echo "Match"
fi
# Assignment
var=value
# Comparison
if [ "$var" = value ]
then
echo "Match"
fi
ShellCheck found an unquoted =
after a word.
If this was supposed to be a comparison, use square brackets: [ "$var" = value ]
If this was supposed to be an assignment, remove spaces around =
: var=value
If the =
was meant literally, quote it:
grep '=true' file.cfg
- Help by adding links to BashFAQ, StackOverflow, man pages, POSIX, etc!