Actually, I have greatly truncated the actual list of directories for this illustration. Note that the directory names are separated by colons, ":". Thus the first directory is "." (current directory), then "/home/yap", then "/usr/local/bin", etc. When you type a command to the unix shell, unix will look for the command by searching first in ".", then in ~/home/yap", etc.
E.g., if you type "javac Hello.java", then unix will look for "javac" (the java compiler) in this list of directories. In this case, it will find javac in the last directory in PATH (namely, /opt/java1.2/bin).
A useful trick is this. Suppose there are commands in a directory "/home/yap/lookup" that you want unix to search first, before any of the current list of directories. You can update your PATH variable this way:
This simply appends "/home/yap/java/bin" to the front of your current list search directories. NOTE: the argument "/home/yap/lookup:`printenv PATH`" creates a string value. The unusual thing is the substring
which is really a request to unix to execute the command "printenv PATH", and substitute the result of that command into the string! Neat trick.