Open System Services Management and Operations Guide (G06.30+, H06.08+, J06.03+)

Specifying a Default Printer
You specify a default printer:
By specifying the Guardian spooler-location name for a system default printer in the
/etc/printcap file. Specifying a system default printer allows you to control which printer
is used for high-volume print jobs.
By specifying the Guardian spooler-location name for a default printer for a specific user in
one of the following ways:
Specify the Guardian spooler-location name for the chosen printer in the user’s printcap
file.
Define the LPDEST or PRINTER environment variable for the user. See “Using a Printer
Environment Variable” (page 248) for more information about these variables.
Use the env shell command, described in the env(1) reference page either online or
in the Open System Services Shell and Utilities Reference Manual. (The env command
can be included in the /etc/profile file or in the default .profile file.)
When a user invokes an OSS printing utility such as the OSS shell lp command, the OSS
environment searches the following items, in the order listed, to determine the destination printer:
1. The command line. For example, in the lp command, you can name the printer in the -d flag
or the -W spl flag. If you specify both flags, the value for the last flag specified is the
destination printer.
2. The LPDEST environment variable value.
3. The PRINTER environment variable value.
4. The printer listed as the first entry in the /etc/printcap file.
5. The printer listed in the first line of the printcap file in the directory specified by the HOME
environment variable. By default, the HOME environment variable specifies the user’s initial
working directory.
If no printer is specified in any of these items, an error is generated and the print job is not
completed. You should provide at least the entry for default in the /etc/printcap file because
all the other items can be omitted or accidentally removed by user actions.
Using the /etc/printcap or printcap File
Both the /etc/printcap and printcap files contain a list of aliases and the corresponding
Guardian spooler-location names for printers. A valid /etc/printcap or printcap file must
contain at least one entry to establish the default printer. In the sample file
/etc/printcap.sample that is installed as part of the OSS file system, this entry is the Guardian
spooler-location name associated with the alias default.
Both files contain lines with the following fields separated by white space:
1. The alias (required). The first alias need not be named default.
2. The Guardian spooler-location name recognized by the spooler (required). Guardian
spooler-location names are not case-sensitive, so you can write the spooler-location name with
lowercase letters.
3. The spooler-supervisor process name (optional). If the spooler-supervisor process name is not
specified, the system assumes the name $SPLS. Guardian process names are not case-sensitive,
so you can write the spooler-supervisor process name with lowercase letters.
The /etc/printcap.sample file contains the alias definitions shown in Example 28. You can
edit this sample file to change its Guardian spooler-location names and then make it either the
/etc/printcap file or a user’s printcap file.
Managing Printers in the OSS Environment 247