"▭" below indicates an otherwise invisible space:
cat << "eof" Helloeof▭
cat << "eof" Helloeof
The end token of your here document has trailing whitespace. This is invisible to the naked eye, but shells do not accept it.
Remove the trailing whitespace.
ShellCheck is a static analysis tool for shell scripts. This page is part of its documentation.