All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sonar.l10n.shellcheck.rules.shellcheck.SC2109.html Maven / Gradle / Ivy

There is a newer version: 2.5.0
Show newest version

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