Skip to content

Month: October 2006

Where to set up Environment variables etc for ALL users on login

OUT OF DATE as of 2008-11-01.

Here is how to set the path or add to the path for all users when they log in. The procedure depends on whether the users’ shell is tcsh (usual case) or bash.  (To determine if your shell is tcsh, type ‘printenv SHELL’.)

———————

TCSH:

For tcsh users, the file to modify is /etc/csh.login. (Also note that other startup conditions can be set for all users in /etc/csh.cshrc).  To add an environment variable simply type

setenv JAVA_HOME /usr/java/1.3.1

To append to the Path in say YOUR OWN .cshrc, type:

setenv PATH “${PATH}:/path/to/be/added”

(This will append your new desired path to the path set for everyone in /etc/csh.login)

————————————————-

BASH:

For users that like bashrc, you can modify /etc/bashrc to add the necessary path or variable. To add a variable, for instance java’s home directory, simply type

export JAVA_HOME=”/usr/java/jdk1.3.1″

If you wanted to add an extra path to sys set up path in YOUR OWN bashrc, type:

export PATH=$PATH:path/to/be/added