Again I've been confused by a bash error message. And again, Google was little help, so I figured I'd post it here so perhaps others won't search in vain.
Here's the error, encountered trying to run a Perl script on a USB drive from my Fedora Core 5 machine:
$ bin/krang_ctl restart
/usr/bin/perl: bad interpreter: Permission denied
The "bad interpreter" part led me on a mission to make sure Perl was installed ok. It was, and scripts in other locations ran fine. Then I spent some time investigating the "Permission defined" angle, but I couldn't find a permissions problem anywhere.
Finally I looked at how the USB disk was mounted and there it was:
# grep Cube
/media/Cube ext3 rw,nosuid,noexec,nodev 0 0
Note the "noexec" there! Fedora auto-mounted this disk with "noexec" turned on. I still don't know how to tell Fedora not to do that, but I do know how to fix it after the fact:
/media/Cube/ -o remount,exec
After that the problem went away. How the heck having "noexec" on a mounted filesystem triggers a "bad interpreter" error in bash, I have no idea...
Hope that helps someone!