SC1058 – ShellCheck Wiki

See this page on GitHub

Sitemap


Expected do.

Problematic code:

for file in *
  echo "$file"
done

Correct code:

for file in *
do
  echo "$file"
done

Rationale:

ShellCheck has found a loop that appears to be missing a do statement. In the problematic code, it was simply forgotten.

Verify that the do exists, and that it's in the correct place.

Exceptions:

None


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