[Previous] [Contents] [Next]

lp

Send files to a printer (POSIX)

Syntax:

lp [-cv] [-d name] [-P name] [-n copies] [file...]

Options:

-c
Exit only after further access to any of the input files is no longer required. Note that the QNX implementation of lp exits this way, whether the -c option is specified or not.
-d name
Use the named spooler and/or queue. If name begins with a slash, it is assumed to be a full name, where the last component is the name of a spool queue and the prefix is the name of the spooler (/spooler/queue). If name does not begin with a slash, it is assumed to be a queue name.

If a server is not specified, the utility will use the spooler identified in the LPSRVR environment variable, or /qnx/spooler if LPSRVR is not set.

If a queue is not specified, lp will use the queue identified in the LPDEST environment variable, or the first queue defined in the setup file of the spooler being used if LPDEST is not set.

For more detailed discussion, see Ch. 9, "Print Spooling," in the QNX Installation & Configuration manual.

-n copies
Write this number of copies of the files, where copies is a positive decimal integer. Note that this does not enqueue two copies, but rather sets $(ncopies) metavariable which may be utilized by a copy-in or copy-out rule. See the QNX Installation & Configuration manual for a discussion on print spooling.
-P name
(QNX extension) Same functionality as the -d name option.
-v
(QNX extension) Be verbose; print information about submitted jobs.
file
The pathname of a file to be printed. If no files are specified, lp uses the standard input.

Description:

The lp utility enqueues a file into a print spooler queue. The default printer is used, unless one is specified with the -P name option. The actual writing of files to the output device may occur after lp successfully exits.

Examples:

Print the file myfile:

    lp myfile

Print multiple files with headers:

    pr file1 file2 | lp

Environment variables:

LPSRVR
Use this spool server by default. (Will use /qnx/spooler if not set.)
LPDEST
Use this spool queue by default. (Will use first queue entry in the setup file of the located spooler if not set.)
PRINTER
Historical alternative to LPDEST. Ignored if LPDEST is set.

Exit status:

0
All input files were processed and output successfully.
>0
No output device was available, or an error occurred.

See also:

lpc, lpq, lprm, lpsrvr, pr

Installation & Configuration


[Previous] [Contents] [Next]