Problem Statement-> syntax error near unexpected token `$’do\r” error while running bash script.

using visual studio to write code on windows machine and the bash script is running on Linux github runner vm inside Terraform Local-exec command.

Root Cause -> Since i was using windows machine and visual studio to write code and the default setting was set to CRLF and the code was running on Linux machine which needs LF

Solution ->

1> Click on CRLF at the bottom of visual studio code windows

bash shell script errors - syntax error near unexpected token `$'do\r''

2> Select LF as shown below:

bash shell script errors - syntax error near unexpected token `$'do\r''


(Visited 2 times, 1 visits today)

By Arun Sabale

Arun is a Solution Architect on enterprise client management with more than 14 years of experience in IT. Arun Sabale is Blogger and tech enthusiast. His main focus is on Azure cloud infra, Cloud automation with powershell, python, ARM terraform and all cloud infra services like compute, storage, network, automation, function api etc... LinkedIN - https://www.linkedin.com/in/arun-sabale/

Leave a Reply

Your email address will not be published. Required fields are marked *