
org.sonar.l10n.shellcheck.rules.shellcheck.SC2272.html Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sonar-shellcheck-plugin Show documentation
Show all versions of sonar-shellcheck-plugin Show documentation
ShellCheck plugin for SonarQube
The newest version!
Command name contains ==. For comparison, use [ "$var" = value ].
Problematic code
$a/$b==foo/bar
Correct code
[ "$a/$b" = "foo/bar" ]
Rationale
ShellCheck found a command name that contains a ==
. Most likely, this was intended as a kind of comparison.
To compare two values, use [ value1 = value2 ]
. Both the brackets and the spaces around the =
are relevant.
Exceptions
None, though you can quote the ==
to suppress the warning.
Related resources
- Help by adding links to BashFAQ, StackOverflow, man pages, POSIX, etc!
© 2015 - 2025 Weber Informatics LLC | Privacy Policy