When bash executes a program, it only looks for it from the path. If the program is not in the path, the specific path must be provided ,. /run. the dot before sh indicates the current directory.
Several forms of bash calling programs:
1. In Path, directly call: Run. Sh
2. if the path is not in the path, the complete path:/tmp/run. Sh is provided.
3. If it is not in the path, the relative path:./run. Sh is provided.
4. If it is not in path, pass the program as a parameter to Bash: Sh run. Sh
[Root @ rhel6-server TMP] # pwd
/Tmp
[Root @ rhel6-server TMP] # Cat run. Sh
Echo "Hello world! "
[Root @ rhel6-server TMP] # ll
Total 4
-Rwxr-XR-X. 1 Root 20 Feb 28 00:20 run. Sh
[Root @ rhel6-server TMP] # env | grep path
Path =/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin: /usr/bin:/root/bin
[Root @ rhel6-server TMP] # Run. Sh
-Bash: Run. sh: Command not found
[Root @ rhel6-server TMP] #/tmp/run. Sh
Hello world!
[Root @ rhel6-server TMP] #./run. Sh
Hello world!
[Root @ rhel6-server TMP] # sh run. Sh
Hello world!
[Root @ rhel6-server tmp] # Path =.: $ path
[Root @ rhel6-server TMP] # env | grep path
Path =. :/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin: /root/bin
[Root @ rhel6-server TMP] # Run. Sh
Hello world!
[Root @ rhel6-server TMP] #
Ref: http://linux.vbird.org/linux_basic/0210filepermission.php#dir_path