<<-
and indent
with tabs).for f in *.png
do
cat << HTML
<img src="$f" /><br/>
HTML
done > index.html
for f in *.png
do
cat << HTML
<img src="$f" /><br/>
HTML
done > index.html
The here document delimiter will not be recognized if it is indented.
You can fix it in one of two ways:
<<-
instead of <<
, and
indent the script with tabs only (spaces will not be recognized).Removing the indentation is preferred, since the script won't suddenly break if it's reformatted, copy-pasted, or saved with a different editor.
If the line was supposed to be a literal part of the here document, consider choosing a less ambiguous token.
ShellCheck is a static analysis tool for shell scripts. This page is part of its documentation.