Setting up your path

Setting up your path

Many people hard code their path (in their .login) with a command like:
    set path = ( /usr/openwin/bin /usr/local/X11R5/bin /usr/ucb /usr/bin /usr/local/bin )
While this may work, it's inadvisable. The better way to do it is by adding to the default path:
    set path = ( /usr/openwin/bin /usr/local/X11R5/bin $path /usr/local/bin )
(Note the new definition includes $path.) That way, if the system administrator thinks something else should be in everyone's path, it can just be added to the default path and everyone will get it.

You may think it works fine the other way, but then everyone would have to edit their own .login files when we move to a new version of X. Also, with the different flavors of Unix around now, it'll be harder for you to come up with a path which includes all the recommended directories without building on the system default.

And while you're setting up your path, you should consider running cleanpath. (See the cleanpath man page.) It removes missing directories and duplicate listings of directories from your path. (The above examples would almost certainly produce duplicate listings on most Rutgers unix machines.)


This page last updated June 3, 2004.