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

Posted on November 24th, 2008 by Luke Sheldrick.
Categories: IT / Tech.
Tags: , , .

24 11 2008

If you’re getting the above errors, when you try to run a .sh or similar [I’ve seen it with perl scripts too] this is will be due to the file being in dos [windows] format, and probably written in notepad or similar.

If you need to get this into unix format, it can be pretty painless, just run the command

dos2unix filename

dos2unix should be available under most releases of linux. Happy coding.


1 of 11