SC1057 – ShellCheck Wiki

See this page on GitHub

Sitemap


Did you forget the do for this loop?

Problematic code:

while read -r line
  echo $line
done

Correct code:

while read -r line
do
  echo $line
done

Rationale:

ShellCheck found a loop that appears to be missing its do statement. Make sure the loop syntax is correct.

Exceptions:

None.


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