Saturday, May 12, 2012

Solving "/bin/bash^M: bad interpreter: No such file or directory"

If you are getting errors like "/bin/bash^M: bad interpreter: No such file or directory", then I am a mind-reader and can say that you have edited this script on a Windows system. Error looks like:
# ./mysql_backup.sh
-bash: ./mysql_backup.sh: /bin/bash^M: bad interpreter: No such file or directory
You can solve this error by using "dos2unix" as:
# dos2unix mysql_backup.sh

1 comment:

  1. You rock, Aatish - can't believe there are not 700 "thank you"s here...

    ReplyDelete