I found a perl script that refused to run on Max OSX. I would consistently get:
#: bad interpreter: No such file or directory
This link set me on the right direction by suggesting that there were DOS CR characters in the file rather than the *nix LF, but his suggestion didn’t work for me. Instead, I used vim to create a new file and copied the text from a text editor, and simply pasted it into vim.
A bit crude, but it worked for me
vim newfile <esc>:i <now paste> <esc> :wq
If you’ve already got vim open, you can convert the line endings with
:set fileformat=unixin command mode.
Or use any of the (perl|sed|awk|$whathaveyou) oneliners 🙂
Sorry Marko but the command :set fileformat=unix did absolutely nothing when I tried it. Maybe using a different version of OS X (I’m using 10.6.5)