Setting environment variables

To set environment variables in Bourne, Korn, and BASH shells, use the following commands:
variable=value
export variable
where variable is the name of the environment variable, and value is the value you assign to the variable.
To set environment variables in the C shell, use the following command:
setenv variable value
where variable is the name of the environment variable, and value is the value you assign to the variable.

To set the variables so that all users have access to them, in Bourne, Korn, and BASH shells, add the commands to the file /etc/profile. To set them for a specific user only, add the commands to the file .profile in the user's home directory. In C shell, add the commands to the file /etc/csh.cshrc. To set them for a specific user only, add the commands to the file .cshrc in the user's home directory. The environment variables are set each time the user logs in.

The following sections discuss the environment variables you can set for XL C/C++ and applications you have compiled with it: