[ ] to compare values, or remove spaces around
= to assign (or quote '=' if literal).# Assignment
var = value
# Comparison
if $var = value
then
echo "Match"
fi# Assignment
var=value
# Comparison
if [ "$var" = value ]
then
echo "Match"
fiShellCheck 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
ShellCheck is a static analysis tool for shell scripts. This page is part of its documentation.