unexpected end of file in shell script code example
Example: syntax error: unexpected end of file bash
I think file.sh is with CRLF line terminators.
run
dos2unix file.sh
I think file.sh is with CRLF line terminators.
run
dos2unix file.sh