I hit again on this strange behaviour of the system. I'm running Debian 6.0.6 and had quite some troubles executing a script directly from CD/DVD. Finally I had to use:sh /media/cdrom/commandto run it. What is the big deal of having to resort to sh?! What if the script relies on bash features? Really annoying and not much added to security in my opinionDoes anybody know of a good reason for that behaviour?PS:if you try to run it directly with ./... you get an error that does not suggest any hint to the issue (filesystem mounted noexec):bash: ./media/cdrom/command: No such file or directoryIf you run it as bash /media/cdrom/command you get the same error (I think verification of mount options are verified by bash even for commands passed as parameters on the command line.Permanent solution is to add exec to the mount options in /etc/fstab such as:/dev/scd0       /media/cdrom0   udf,iso9660 user,noauto,exec     0       0
Why do I have to use sh to execute scripts from CD/DVD media?
bash;permissions;executable;dvd;media
Filesystems are often mounted noexec,nosuid by default to boost the security a bit. Hence even though you see the executable bit on the file set, kernel will refuse to run it. By calling it in the form of interpreter path/to/script you are requesting the system to run interpreter, which in turn receives path/to/script as an argument and parses it thus bypassing the filesystem imposed restriction (you might be able to achieve the same effect with compiled executables with: /lib/ld-linux.so.1 path/to/executable).Hence one option is mount -o exec .... You might want to put the option into /etc/fstab - usually by replacing the defaults option with defaults,exec. However, unless you really know what you are doing, I would advise against this.As for the BASH specifics, I believe bash will interpret those even when running as sh. And you are definitely free to invoke it as bash path/to/script.