11.7.3 Cannot Add Printer
Queue
An administrator can set a print queue as the default print queue. There are two methods to set a default printer: using the smitty qdefault fast path and using the LPDEST environment variable.
To define a default printer:
The LPDEST environment variable specifies the default print queue once it has been set. A number of print commands, such as enq, lprm, lpr, qstatus, pac, and many more, use this environment variable as the default if it is set and if a printer is not specified. For some commands, it overrides the printer variable value.
Using the printenv command to look at a system before the LPDEST environment variable is set will produce the following output:
# printenv _=/usr/bin/printenv LANG=en_US LOGIN=root NLSPATH=/usr/lib/nls/msg/%L/%N:/usr/lib/nls/msg/%L/%N.cat PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin LC__FASTMSG=true LOGNAME=root MAIL=/usr/spool/mail/root LOCPATH=/usr/lib/nls/loc USER=root AUTHSTATE=compat SHELL=/bin/ksh ODMDIR=/etc/objrepos HOME=/ TERM=vt100 MAILMSG=[YOU HAVE NEW MAIL] PWD=/ TZ=CST6CDT A__z=! LOGNAME
To set the default queue using the LPDEST environment variable do the following:
If you are in the sh (Bourne) shell, enter the following command:
LPDEST=NewValue; export LPDEST
If you are in csh (C) shell, enter the following command:
setenv LPDEST=NewValue
If you are in ksh (Korn) shell, enter the following command:
export LPDEST=NewValue
# echo $LPDEST virprt1
# printenv _=/usr/bin/printenv LANG=en_US LOGIN=root NLSPATH=/usr/lib/nls/msg/%L/%N:/usr/lib/nls/msg/%L/%N.cat PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin LC__FASTMSG=true LOGNAME=root MAIL=/usr/spool/mail/root LOCPATH=/usr/lib/nls/loc USER=root AUTHSTATE=compat SHELL=/bin/ksh ODMDIR=/etc/objrepos HOME=/ TERM=vt100 MAILMSG=[YOU HAVE NEW MAIL] PWD=/ TZ=CST6CDT LPDEST=virprt1 A__z=! LOGNAME
Note that the LPDEST environment variable is now set to virprt1 as highlighted in the preceding example.