[CentOS] Running shell scripts from external media

Greg Bailey gbailey at lxpro.com
Thu Jul 3 14:53:25 UTC 2008

James B. Byrne wrote:
> Problem:
> 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

Usually, I've found this is because the file is stored with DOS style 
line endings.
Maybe you could try:

dos2unix -n hello.sh hello2.sh
chmod +x hello2.sh

Does that fix it?


More information about the CentOS mailing list