variable=value export variablewhere variable is the name of the environment variable, and value is the value you assign to the variable.
setenv variable valuewhere 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: