Open System Services Management and Operations Guide (G06.30+, H06.08+, J06.03+)
Example 28 Sample /etc/printcap File /etc/printcap.sample
default \COMM.$S.#DEFAULT
ps \COMM.$S.#POST7
titan \COMM.$S.#TITAN7
land \COMM.$S.#LAND7
build \COMM.$S.#BUILD
You assign aliases other than that of the default printer so users can refer to printers by names that
are more convenient than the Guardian spooler-location names. For example, you might want to
use the alias titan in place of the Guardian spooler-location name \COMM.$S.#TITAN7.
When a user enters a print command that specifies an alias, the printing utility checks the directory
specified by the HOME environment variable for a printcap file. If a printcap file is found, the
printing utility searches it for the specified alias.
If the alias is found in the printcap file, the printing utility maps the alias to the Guardian
spooler-location name given in printcap. This behavior allows a user to have a different value
for the alias default from the one in the /etc/printcap file; however, an alias specified in
a printcap file is not actually used as a default value in a shell command line. For example,
assume that /etc/printcap contains
default \COMM.$S.#DEFAULT
and printcap contains
default \FORTY.$S1.#BOOK
If the user enters the following OSS shell command:
lp file
the file file is printed at the Guardian spooler-location named \COMM.$S.#DEFAULT, because
that command does not specify a printer definition and therefore uses the default definition in
/etc/printcap. However, if the user enters the following OSS shell command:
lp -D default file
the file file is printed at the Guardian spooler-location named \FORTY.$S1.#BOOK, because
that is the Guardian spooler-location name specified for default in printcap.
When a user enters a print command that specifies an alias, and if either the alias is not found in
the printcap file or the printcap file does not exist, the printing utility searches for the alias
in the /etc/printcap file in order to map the alias to the Guardian spooler-location name.
Once you have set up an alias for a printer, you can validate this alias by using it in an lp
command to print a sample text file, as described in the Open System Services User’s Guide.
Using a Printer Environment Variable
Assign a value to the environment variable LPDEST or PRINTER to indicate the name of the default
printer for a user. You can specify the same default printer for all users by placing the specification
in the /etc/profile file, or you can specify a different default printer for each user by placing
the specification in the .profile file.
For example, the /etc/printcap file in Example 28 (page 248) defines the printer with the alias
default and the Guardian spooler-location name \COMM.$S.#DEFAULT as the default printer.
To set the environment variable LPDEST for a specific user to the alias default, so that the default
printer for that user is \COMM.$S.#DEFAULT, place the following specification in that user’s
.profile file:
export LPDEST=default
248 Managing OSS Devices