Skip to content
Vidar Holen edited this page Oct 20, 2022 · 1 revision

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.

Related resources:

  • Help by adding links to BashFAQ, StackOverflow, man pages, POSIX, etc!

ShellCheck

Each individual ShellCheck warning has its own wiki page like SC1000. Use GitHub Wiki's "Pages" feature above to find a specific one, or see Checks.

Clone this wiki locally