The following should explain it:
Create a shell script for testing:
$ echo '#!/bin/bash' > testme
$ echo 'ps -ef | grep $$ | tac | tail -1' >> testme
$ cat testme
ps -ef | grep $$ | tac | tail -1
Execute the following:
-bash: testme: command not found
-bash: ./testme: Permission denied
$ su root
# cp testme /usr/local/bin
-bash: /usr/local/bin/testme: Permission denied
$ csh testme
dude 1922 1895 0 14:26 pts/0 00:00:00 csh testme
$ chmod u+x testme
dude 1942 1895 0 14:27 pts/0 00:00:00 /bin/bash ./testme
What does the above output tell us?
In order to execute a script, similar to a command as shown in 2, it needs execute privileges. The command interpreter (shell) will only execute files in directories according to the $PATH variable. For security reasons, the current path (./) should not be specified in the $PATH environment variable.
When specifying the script as a shell parameter shown in 3, the script does not need to have execute privileges, and can reside in the current working directory. Also, Irrespective of the shebang or hash-bang defined in the script, the shell interpreter specified at the command prompt will be used for script execution.