Skip to content

Files

Latest commit

 

History

History
31 lines (19 loc) · 675 Bytes

SC2286.md

File metadata and controls

31 lines (19 loc) · 675 Bytes

Pattern: Use of empty string as command name

Issue: -

Description

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.

Example of incorrect code:

jq 
   ''
   file.json

Example of correct code:

jq \
  '' \
  file.json

Further Reading