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.
- Enter this command to change to your home directory:
cd
- Make a backup copy of the file:
cp -p .profile .profile.org
The -p flag gives the copy the same file permissions and modification date and time as the original file. - Enter this command:
vi .profile
- A typical .profile file contains lines similar to:
PATH=.:$HOME/bin:/bin:/usr/bin:/etc:/usr/ucb:/usr/bin/X11:tools/ usr/bin:/usr/lpp/cmvc/bin:/usr/OV/bin:/usr/local/tools/rs6/bin:/usr /local/tools/rs6:/usr/dt/bin
export PATH export EDITOR=vi
- 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. - Save the change in plain text format and exit from the editor.
- Make the change effective by entering this command:
. .profile
- Verify the change by entering the command:
echo $PDPRINTER
The logical destination name you entered displays.