next up previous
Next: A Simple Shell Script Up: Internal and External Commands Previous: PATH

Changing PATH

Very often it will be necessary to add new directories into PATH. The command for setting or changing the environment variable is setenv. To add, for example, user's cs241/a1 directory to the PATH, type: setenv PATH $HOME/cs241/a1:$PATH This will add cs241/a1 directory to the beginning, which means that the cs241/a1 directory will be searched by shell first. Similarly one can add a directory to the end of the list. Note, that HOME is another environment variable, which defines user's home directory.



Instructional Support Group 2008-08-05