bad interpreter

Remove control-m characters in vi/vim

vi/vim FAQ: How can I remove control-m (^M) characters in a text file using vi or vim?

If you've ever opened a text file with vi (or vim) and saw a message on the bottom of the screen that says "dos" or "dos format", there's a reason for this. The file was probably created on a DOS or Windows computer, and it contains extra binary characters that are not normally found in a file created on a Unix or Linux system.

Shell script error - bad interpreter - No such file or directory

Some times when you take a file from a DOS/Windows system and move it to a Linux or Unix system you'll have problems with the dreaded ^M character. This happened recently when I moved an Ant script from a Windows system to my Mac OS X system. When I tried to run the shell script under the Mac Terminal I got this error message:

: bad interpreter: No such file or directory

I couldn't figure out what the message meant at first, but finally it hit me: the dreaded ^M problem. Sure enough, I opened the file in the vim editor, like this:

Syndicate content