How to add something to your path

You will need to edit your .cshrc file that resides in your home directory in order to change your path, and then log out and back in to make the change take effect.

NOTE: If you try to edit your .cshrc file and the system tells you that the file is read only, you will need to "change the mode" of the file to give yourself write permission. For example, to give yourself write permission on your .cshrc file, just type

cd
chmod  u+w  .cshrc

For the whole story about UNIX file permissions, see Unix file permissions

To see your current path, type

echo $path

My path is set in my .cshrc file by the lines

set path = ( \
             /pkgs/texlive/2005/bin/sparc-solaris/ \
             /pkgs/teTeX/bin/sparc-sun-solaris2.5.1 \
             ${HOME}/bin \
             /sbin \
             /usr/sbin \
                         /bin \
             /usr/bin \
             /usr/ccs/bin \
             /local/bin \
             /usr/local/bin \
             /usr/local/sbin \
             /opt/csw/bin \
             /usr/openwin/bin \
             /opt/SUNWspro/bin \
             /usr/ucb \
             /pkgs/X11/bin\
             /pkgs/gnu/bin\
             /pkgs/misc/bin\
                         . )

Notice how I have added the line

             /pkgs/texlive/2005/bin/sparc-solaris/ \

near the beginning of my path. Another, and perhaps safer, way to do this is to add the line

set path=( /pkgs/texlive/2005/bin/sparc-solaris/ $path )

to your .cshrc file at a point just below the lines that set your path.

NOTE: To determine the version of TeX that you are using right now, you can type

which amstex

If the output of this command is

/usr/local/TeX/bin/amstex

then you are using the old TeX and you won't be happy with it for very much longer.

Remark: Don't let it bother you that the old TeX location

       /pkgs/teTeX/bin/sparc-sun-solaris2.5.1 \

is still in my path. The important thing is that it is BELOW the new texlive entry. Commands are searched for in the directories listed in your path in the order in which they appear. When the command is found, the system exits the search happy and ignores the later directories. I could have commented out the old teTeX line or even deleted it if I wanted to. The reason I didn't is that if I happen to try to use an old command that was included with the old TeX, but isn't with the new, my path will still let the system find it.


Back to the Network News, Volume 32



Back to the Network News Index Page