Tuesday, June 19, 2007

: bad interpreter: No such file or directory

When I run a bash script, it gives the following error:

: bad interpreter: No such file or directory

It turn out that the carriage return was not properly converted to *nix format, since it was written using Notepad in Windows.

Quick fix:
$ dos2unix filename -- convert to *nix format
$ unix2dos filename -- convert to Windows/DOS format


Blogger APC said...

Notepad is a very bad thing to be using for editing anything. Personally I use TextPad, which apart from anything else has the option to save files in Unix format.

Cheers, APC

6/19/2007 6:30 PM  
Anonymous Anonymous said...

You Are God!

9/09/2011 3:24 PM  

Post a Comment

<< Home