lp — Send a file to a printer
Format
lp [–cmsw] [–d dest] [–n number] [–o printer-option] [–t title] [file …]
Description
lp prints one or more input files on a printer. If you do not specify any files on the command line, or if you specify a file name of – (dash), lp reads and prints the standard input. The files are printed in the same order that they are specified on the command line.
Options
- –c
- Immediately copies the files to be printed. This ensures that the version of the file that exists when the print request is made is the version printed.
- –d dest
- Specifies dest as the output device. –d takes
precedence over the LPDEST environment
variable, which in turn takes precedence over the PRINTER
environment variable.
dest is a comma-separated list of arguments that is passed to JES. The first item must be the “destination_name”. The destination name can take the form NODE.USER. The second item must be the “class”. The third item must be the “forms”. Not all items must be specified, but the items must be specified in the proper order. The definition of “destination_name”, “class”, and “forms” is defined by JES.
For more information about the dest option, see z/OS MVS JCL Reference.
- –m
- This option is not implemented.
- –n number
- Prints number copies of each input file (the default is 1 copy).
- –o printer-option
- This option is not implemented.
- –s
- This option is not implemented.
- –t
- This option is not implemented.
- –w
- This option is not implemented.
Examples
- To send a previously formatted file to a JES printer:
You can specify more than one file name with the command.lp filename
- The following prints the file temp.prt using the default
printer destination and specifying class c (where c is
the locally designated class for secured information):
The parameters on the -d option are positional, so if you omit a destination, you must still include the comma.lp –d ,c temp.prt lp –d,c temp.prt
Environment variables
- LPDEST
- Names the output device. This variable takes precedence over PRINTER.
- PRINTER
- Names the output device if LPDEST is not defined.
Localization
- LANG
- LC_ALL
- LC_CTYPE
- LC_MESSAGES
- NLSPATH
See Localization for more information.
Exit values
- 0
- Successful completion
- >0
- An error occurred
Portability
POSIX.2, X/Open Portability Guide.
The –m, –o, –s, –t, and –w options are extensions to the POSIX standard.