Google Cloud Shell :- Syntax error: “done” unexpected (expecting “do”)

running a shell script in Cloud shell and facing error :- “Syntax error: “done” unexpected (expecting “do”)”

Open the script in editor that is failed.

As highlighted in yellow the end of the line sequence should be “LF” instead of  “CRLF” change it and save the script and re-run it.

Advertisements