Open System Services Shell and Utilities Reference Manual (G06.28+, H06.05+)

User Commands (k - l) lp(1)
Search Alogrithm
The search algorithm for the printer locations is as follows. The printer destination specication
in the -d ag or the Guardian spooler name specication in the -W spl ag is used whenever it is |
specied. If both the -d and the -W spl ags are specied, the last printer location that is |
specied is used. Otherwise, the printer location is rst the value set for the environment vari- |
able LPDEST, and then, if LPDEST is not set, the value set for the PRINTER environment |
variable is used. If the PRINTER environment variable is also not set, the value set for the |
GUARDIAN_PRINTER is used. When none of the LPDEST, PRINTER,or |
GUARDIAN_PRINTER environment variables are set, a system default location value
(#DEFAULT), stored in the printcap database le, is used. Most HP NonStop server spooler
systems are normally congured with a #DEFAULT location so jobs can always be routed to a
printer device.
printcap Database
Aliases for the spooler location names are stored in the printcap database le. The lp command
searches printcap everytime it needs to resolve the alias to its respective spooler location. A
system default location should always be specied in the printcap le and should appear as the
rst entry in the le. printcap has the following format:
<alias name> <spooler location name>
The system is supplied with a default printcap le with aliases for all the devices that are avail-
able to the system. You can create your own printcap le as needed. If you create your own
printcap le, the lp command searches your own printcap le rst and then the system default
printcap le in the /etc le.
Preprocessing File Data
The lp command does not preprocess data in Guardian EDIT les, compiler listing les, and
PostScript les. lp performs limited preprocessing of the control characters in OSS ASCII text
les. For example, line feed control characters signify the end of a record and form feed control
characters signify a page eject. Because lp has limited capability to handle all of the control
characters correctly (for example, tabs and backspaces), use the pr command to preprocess the
le data before invoking lp. lp translates unrecognizable control characters to blank characters.
EXAMPLES
1. To send an OSS text le to a printer using the destination-searching algorithm, enter:
cat le | lp
If the operation is successful, the exit status 0 is returned and a message,
stdin is routed to printer_name with request id id_number
is written to the standard output le.
2. To print multiple les with the destination and the heading for the banner specied,
enter:
lp -d hplp -t "myprint" le1 /G/system/vol/subvol/le
527188-007 Hewlett-Packard Company 573