The only reason you may not execute the script directly due to permissions is that it does not have execute for the current running UID and GID of the user/process.
With permissions 654 that means only someone in the same group as the script BUT is not the owner of the script can 'execute' it.
A script however also requires you have read access, so the running 'interpreter' regardless of if that is a shell, perl, or other program, can also read the file to execute it.
In older UNIX's a unreadable shell script was possible by using permissions 4711.
That is it is executable by anyone, but Set-UID's to the owner of the script, which provides read permission. However I believe Set-UID scripts are not permitted under Linux.
--
Okay. NONE of this however matters if you run the interpreter yourself! Just as forum user "vikas027" pointed out. That is you run the script using a command like
bash script_filename
awk -f script_filename
In this case the script is being treated a just a plain file that is read by the interpretor command. Only read permission is required in this case, as such the script could have permissions of just 444 (read only to everyone, including owner) for it to work (unless the script modifies itself! Weird, but I have see it done!)
--
There is however one other situation for things like shell script. Source scripts.
that is you don't want the shell to run the script as a sub-process, by launching a new interpretor, but by having the currently running shell interpret it. In some languages this is also known as an 'include'.
A source shell is typically requires if you want that script to modify the current environment (and not a sub-shells environment that then gets deleted). For example to change the current directory (working directory), or set environment variables (like PATH), or local shell variables (like the prompt).
In such a case teh script is typically not made executable, and it is also a good idea to give the script a fake interpretor, that just generates an appropriate error. For example
Code:
#!/bin/echo "Source Script Only -- Do not execute -- ABORTING"
# Setup software package to working environment
PATH="/opt/software/bin:${PATH}"
MANPATH="/opt/software/man:${MANPATH}"
LD_LIBRARY_PATH="/opt/software/lib:${LD_LIBRARY_PATH}"