/bin/sh^M bad interpreter in Linux, How to solved it?
January 10 2015
You may get an error when execute shell script in linux based system,
-bash: ./samplescript.sh: /bin/sh^M: bad interpreter: No such file or directory
You need to check the file using UNIX line ending or can use dos2unix command to change the file format. If you can not found the command install it.
dos2unix: converting file samplescript.sh to UNIX format ...