Setting environment variables

The Bourne Again SHell (bash) on Linux(R) systems is similar to the Bourne Shell (bsh) found on AIX(R) systems. Use the bash interface to set the environment variables required by the XL C/C++ compiler, either through the command line or with a command file script.

The following statements, either typed at the command line or inserted into a command file script, show how you can set environment variables in the Bourne Again SHell. Paths shown assume that you are installing the compiler in the default installation location.

LANG=en_US
NLSPATH=$NLSPATH:/opt/ibmcmp/msg/%L/%N:/opt/ibmcmp/vacpp/8.0/msg/%L/%N
export LANG NLSPATH

To set the variables so that all users have access to them, 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. The environment variables are set each time the user logs in.

The following sections discuss the environment variables you can set for the compiler: