org.sonar.l10n.shellcheck.rules.shellcheck.SC2109.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
Instead of [ a || b ], use [ a ] || [ b ].
Problematic code
[ "$1" = "-v" || "$1" = "-help" ]
Correct code
[ "$1" = "-v" ] || [ "$1" = "-help" ]
Rationale
||
can not be used in a [ .. ]
test expression. Instead, make two [ .. ]
expressions and put the ||
between them.
Exceptions
None.
© 2015 - 2025 Weber Informatics LLC | Privacy Policy