In a file

To set an environment variable in a file, you need to edit the file with an editor. If you do not know how to use an editor, or the editor you are using is not capable of saving in the plain text (ASCII) file format, do not start. Ask your administrator for assistance.

These example shows how to set the PDPRINTER environment variable in your .profile file, using the vi editor.

  1. Enter this command to change to your home directory:
  2. Make a backup copy of the file:
    cp -p .profile
    The -p flag gives the copy the same file permissions and modification date and time as the original file.
  3. Enter this command:
    vi .profile
  4. A typical .profile file contains lines similar to:
    export PATH
    export EDITOR=vi
  5. Insert or modify this line in the .profile file:
    export PDPRINTER=LogicalDestinationName
    where LogicalDestinationName is the name of the logical destination you want to set as your default.
  6. Save the change in plain text format and exit from the editor.
  7. Make the change effective by entering this command:
    . .profile
  8. Verify the change by entering the command:
    echo $PDPRINTER

    The logical destination name you entered displays.