SC1133 – ShellCheck Wiki

See this page on GitHub

Sitemap


Unexpected start of line. If breaking lines, |/||/&& should be at the end of the previous one.

Problematic code:

dmesg
  | grep "error"

Correct code:

dmesg |
  grep "error"

Rationale:

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:

Exceptions:

In v0.7.2 and below, this warning triggered incorrectly when starting a line with &>. In these versions, you can either ignore the warning, or move the redirection after the command name.


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