-
Notifications
You must be signed in to change notification settings - Fork 1.8k
SC2284
Joachim Ansorg edited this page Nov 12, 2021
·
2 revisions
if $var == value
then
echo "Match"
fi
if [ "$var" = value ]
then
echo "Match"
fi
ShellCheck found an unquoted ==
after a word.
This was most likely supposed to be a comparison, so use square brackets as in the correct code.
If the ==
was supposed to be literal, you can quote it to make ShellCheck ignore it:
grep '===' file.js
- Help by adding links to BashFAQ, StackOverflow, man pages, POSIX, etc!