[CentOS] Running shell scripts from external media

Stephen Harris lists at spuddy.org
Thu Jul 3 15:19:50 UTC 2008

> As 'root', when running a script resident on the external drive mounted at
> /media/disk I receive the following error:
> /bin/sh: bad interpreter: Permission denied

Are you sure the script isn't in DOS format, with CRLF line endings?  If
so then the interpreter it's trying to run is actually /bin/sh^M (with
a control-M at the end).  Which is wrong :-)

Try running dos2unix on it and trying it again.



More information about the CentOS mailing list