Problem scenario
You drafted a Bash script on a Windows computer. You then uploaded it to Google Cloud Platform via a web browser feature. When you run the bash script on a Linux server (e.g., in GCP), you get this error “line 5: $’\r’: command not found”. You do not want to install dos2unix or any new packages. What should you do?
Solution
The file needs to be modified or “cleaned up.”
…
Continue reading “How Do You Troubleshoot the Bash Script Error “line 5: $’\r’: command not found”?”