I have a foo.sh
file in my current directory. If I try to run ./foo.sh
, I get:
-bash: ./foo.sh: /bin/sh: bad interpreter: Permission denied
But if I run /bin/sh ./foo.sh
then it runs fine.
How can I fix this so I can just run ./foo.sh
and it automatically runs it with /bin/sh?
Edit: Okay, this is Chrome OS and this particular folder is mounted with noexec
. Apparently that foils the ability to just run ./foo.sh
; but why? Why can I still run sh foo.sh
to achieve the exact same thing? What security, then, does noexec
give?
noexec
works its magic.