PATH environment variable
is used to locate commands within the SunOS directory hierarchy. By setting
PATH you create a fixed set
of directories that the system always searches whenever you enter the name
of a command.
For example, if you have no
variable set and you want to copy a file, you need to enter the full pathname
for the command, /usr/bin/cp. However, if you have set
PATH variable to include the
directory /usr/bin, then you can simply type cp and your system will always execute the command. This is because
your system searches for the cp command in every directory
named in the PATH variable, and executes it when it is found. Using the
PATH variable to list the commonly used SunOS
command directories can thus significantly streamline your work.
For the Bourne and Korn shells, the
PATH variable is specified in your .profile
file (in your home directory) using the following syntax:
where home represents the path name of your home directory.
For the C shell, the
variable is specified in your .cshrc file (in your home
directory) using the following syntax:
set path=(. /usr/bin home/bin)
where home is the path name of your home directory.
example% source .cshrc