Archive for May, 2013

DOS-based file format

No Comments »

I was running into an issue where a script I’d gotten from the net would not run and exited with an error:

[root@asterisknow ~]# -s
-bash: /usr/local/sbin/ /bin/sh^M: bad interpreter: No such file or directory
[root@asterisknow ~]#

Turned out to be that the file was in a DOS-based format. I simply did the following in vim to correct this:

:set fileformat=unix

This set the file to the unix format and allowed me to run the script without issue. 🙂