Skip to content

Files

Latest commit

 

History

History
31 lines (19 loc) · 764 Bytes

SC1133.md

File metadata and controls

31 lines (19 loc) · 764 Bytes

Pattern: Unexpected |/||/&& at line start

Issue: -

Description

ShellCheck has found a line that unexpectedly started with |, || or &&. This usually happens when a line is broken incorrectly.

When breaking around a |, || or &&, there are two options:

  • Break the line after this token. dmesg is a complete command by itself, but dmesg | is not so the shell knows to continue on the next line.
  • Use a \ at the end of the previous line to explicitly tell the shell to continue on the next.

Example of incorrect code:

dmesg
  | grep "error"

Example of correct code:

dmesg |
  grep "error"

Further Reading