Editing the /etc/environment file

To set an environment variable in the /etc/environment file, you need to edit the file with an AIX editor. See How are environment variables set? and What restrictions apply? for additional information.

This example shows how to set the PDPRINTER environment variable in the /etc/environment file using the vi editor:

  1. Enter this command to change to the /etc directory:
    cd /etc
  2. Enter this command:
    vi environment

    A typical /etc/environment file contains lines similar to this:

    NLSPATH=/usr/lib/nls/msg/%L/%N:/usr/lib/nls/msg/%L/%N.cat
    LANG=en_US
     

  3. Insert or modify this line in the /etc/environment file:
    PDPRINTER=LogicalDestinationName
    where LogicalDestinationName is the name of the logical printer you want to set as the default logical printer for all users.
  4. Save the change in plain text format and exit from the editor.
  5. Make the change effective by entering the command:
    . ./etc/environment
  6. Verify the change by entering the command:
    echo $PDPRINTER
    The logical destination name you entered displays.