Skip to content
Vidar Holen edited this page Oct 20, 2022 · 3 revisions

Expected another argument for this operator.

Problematic code:

[ $a -ne ]

Correct code:

[ $a -ne $b ]

Rationale:

ShellCheck found a test operator without an operand. This could be a copy-paste fail, bad linebreak, or trying to use <> instead of != or -ne.

Exceptions:

None.

Related resources:

  • Help by adding links to BashFAQ, StackOverflow, man pages, POSIX, etc!

ShellCheck

Each individual ShellCheck warning has its own wiki page like SC1000. Use GitHub Wiki's "Pages" feature above to find a specific one, or see Checks.

Clone this wiki locally