11.7.3 Cannot Add Printer Queue

11.8 Setting Default Printers

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.

11.8.0.1 Using smitty qdefault Fast Path

To define a default printer:

  1. Enter the command smitty qdefault. The screen in Figure 112 is produced.



    Figure 112: Setting System Default Print Queue

  2. Specify the queue name for the print queue you wish to be the default.

  3. Press the Enter Key and wait until the Command: Ok screen displays, then exit SMIT to complete the process.

11.8.0.2 The LPDEST Environment Variable

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:

  1. Change the value of the LPDEST environment variable in one of the following ways:

    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
    

  2. To verify the current value of the LPDEST environment variable, use the following commands:
    # echo $LPDEST
    virprt1
    
    

  3. Using the printenv command after setting the variable 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
    LPDEST=virprt1
    A__z=! LOGNAME
    

Note that the LPDEST environment variable is now set to virprt1 as highlighted in the preceding example.

11.9 References