Open System Services Shell and Utilities Reference Manual (G06.29+, H06.08+, J06.03+)

lp(1) OSS Shell and Utilities Reference Manual
Search Alogrithm
The search algorithm for the printer locations is as follows. The printer destination specification
in the -d flag or the Guardian spooler name specification in the -W spl flag is used whenever it is
specified. If both the -d and the -W spl ags are specified, the last printer location that is
specified is used. Otherwise, the printer location is first 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 file, is used. Most HP NonStop server spooler
systems are normally configured 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 file. The lp command
searches printcap everytime it needs to resolve the alias to its respective spooler location. A
system default location should always be specified in the printcap file and should appear as the
first entry in the file. printcap has the following format:
<alias name> <spooler location name>
The system is supplied with a default printcap file with aliases for all the devices that are avail-
able to the system. You can create your own printcap file as needed. If you create your own
printcap file, the lp command searches your own printcap file first and then the system default
printcap file in the /etc file.
Preprocessing File Data
The lp command does not preprocess data in Guardian EDIT files, compiler listing files, and
PostScript files. lp performs limited preprocessing of the control characters in OSS ASCII text
files. 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
file data before invoking lp. lp translates unrecognizable control characters to blank characters.
EXAMPLES
1. To send an OSS text file to a printer using the destination-searching algorithm, enter:
cat file | 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_numbe r
is written to the standard output file.
2. To print multiple files with the destination and the heading for the banner specified,
enter:
lp -d hplp -t "myprint" file1 /G/system/vol/subvol/file
574 Hewlett-Packard Company 527188-021