SC2122 – ShellCheck Wiki

See this page on GitHub

Sitemap


>= is not a valid operator. Use ! a < b instead.

Problematic code:

[[ a &lt;= b ]]

Correct code:

[[ ! a > b ]]

Rationale:

The operators <= and >= are not supported by Bourne shells. Instead of "less than or equal", rewrite as "not greater than".

Exceptions

None


ShellCheck is a static analysis tool for shell scripts. This page is part of its documentation.