Carriage return causes error in bash in CygwinPosted: May 15, 2014
When trying to run a bash script in Cygwin you may experience mysterious errors, like
- ‘\r’ : command not found
- “No such file or directory” with \#015 here and there in the file paths.
Did you use Windows software to edit the shell script file?
If so, the problem is extra carriage return symbol (cr aka \#015) added by Windows at the end of the strings.
Clean your shell file by running it through dos2unix utility before execution.
Rename the script file, say script.sh to something like script.dos, then run
dos2unix script.dos script.sh