How are environment variables set?

You can use these methods to set or change values for environment variables:

  • If you are an administrator, you can set AIX environment variables and InfoPrint Manager environment variables in the /etc/environment file or in the InfoPrint SMIT operator's interface environment file by using an AIX editor.

    Settings in these files apply to all sessions for all users, unless users override them through their .profile files or from the command line.

  • You can modify your .profile file in your home directory by using an AIX editor. Settings in the .profile file override settings in the /etc/environment file. These settings apply only to you and are in effect for all AIX sessions, unless you override the settings from the command line.
  • You can enter one of these commands on the command line to set environment variables for a single AIX session:
    • In the Korn shell or the Bourne shell, use the export command.
    • In the C shell, use the setenv command.
    Command line settings override settings in the /etc/environment file and .profile file. These settings apply only to you and are in effect only until you exit the AIX session from which you issued the command.

You cannot change the environment of a running process. If you change the value of an environment variable, you must restart any process that was started before the change if the change is to take effect for that process. For example, an InfoPrint Manager server is a process. If you change the /etc/environment file, you must stop and start the server again for the change to take effect.