Skip to content
Vidar Holen edited this page Jun 6, 2021 · 1 revision

This empty string is interpreted as a command name. Double check syntax (or use 'true' as a no-op).

Problematic code:

jq 
   ''
   file.json

Correct code:

jq \
  '' \
  file.json

Rationale:

ShellCheck found an empty string used as a command name. This is never valid.

If the command is intended to do nothing, use true aka : instead. Otherwise, determine why an empty string ended up as a command name and fix it accordingly. In the example, each line was interpreted as a separate command due to missing line continuations.

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