lp(1) DG/UX R4.11MU05 lp(1)
NAME
lp, cancel - send/cancel requests to an LP print service
SYNOPSIS
lp [printing-options] [files]
lp -i request-IDs printing-options
cancel [request-IDs] [printers]
cancel -u login-ID-list [printers]
DESCRIPTION
The first form of the lp command arranges for the named files and
associated information (collectively called a request) to be printed.
If no file names are specified on the command line, the standard
input is assumed. The standard input may be specified along with
named files on the command line by listing the file name(s) and
specifying - for the standard input. The files will be printed in
the order in which they appear on the shell command line.
The LP print service associates a unique request-ID with each request
and displays it on the standard output. This request-ID can be used
later when canceling or changing a request, or when determining its
status. [See the section on cancel for details about canceling a
request, and lpstat(1) for information about checking the status of a
print request.]
The second form of lp changes the options for a request. The print
request identified by request-ID is changed according to the printing
options specified. The printing options available are the same as
those with the first form of lp. If the request has started printing
locally, it will be stopped and restarted from the beginning (unless
you use the -P option). If the request has finished printing, or if
the request is for a remote printer and the client scheduler has
begun sending the print request to the remote print scheduler, the
change is rejected.
The cancel command lets you cancel print requests previously sent
with the lp command. The first form of cancel permits cancellation
of requests based on their request-ID. The second form of cancel
permits cancellation of requests based on the login-ID of their
owner.
Sending a Print Request
The first form of the lp command is used to send a print request to a
particular printer or group of printers.
Options to lp must always precede file names, but may be specified in
any order. The following options are available for lp:
-c Make copies of the files before printing. Normally, files
will not be copied, but will be linked whenever possible. If
the -c option is not given, then the user should be careful
not to remove any of the files before the request has been
printed in its entirety. It should also be noted that if the
-c option is not specified, any changes made to the named
files after the request is made but before it is printed will
be reflected in the printed output.
-d dest
Choose dest as the printer or class of printers that is to do
the printing. If dest is a printer, then the request will be
printed only on that specific printer. If dest is a class of
printers, then the request will be printed on the first
available printer that is a member of the class. If dest is
any, then the request will be printed on any printer which
can handle it. Under certain conditions (availability of
printers, file space limitations, and so on) requests for
specific destinations may not be accepted [see lpstat(1)].
By default, dest is taken from the environment variable
LPDEST (if it is set). Otherwise, a default destination (if
one exists) for the computer system is used. Destination
names vary between systems [see lpstat(1)]. If the printer
is located on a remote system that has a pre-5.4 version of
the LP scheduler, the lp command submits the request through
a remote shell using remsh(1C). Your system and the remote
system must be configured to permit execution of a remsh
command (by having your system's name in the remote system's
/etc/hosts.equiv file).
-f form-name [-d any]
Print the request on the form form-name. The LP print
service ensures that the form is mounted on the printer. If
form-name is requested with a printer destination that cannot
support the form, the request is rejected. If form-name has
not been defined for the system, or if the user is not
allowed to use the form, the request is rejected [see
lpforms(1M)]. When the -d any option is given, the request
is printed on any printer that has the requested form mounted
and can handle all other needs of the print request.
-H special-handling
Print the request according to the value of special-handling.
Acceptable values for special-handling are defined below:
hold Don't print the request until notified. If printing
has already begun, stop it. Other print requests will
go ahead of a held request until it is resumed.
resume Resume a held request. If it had been printing when
held, it will be the next request printed, unless
subsequently bumped by an immediate request.
immediate
(Available only to LP administrators)
Print the request next. If more than one request is
assigned immediate, the requests are printed in the
reverse order queued. If a request is currently
printing on the desired printer, you have to put it on
hold to allow the immediate request to print.
-m Send mail [see mail(1)] after the files have been printed.
By default, no mail is sent upon normal completion of the
print request.
-n number
Print number copies (default is 1) of the output.
-o option
Specify printer-dependent options. Several such options may
be collected by specifying the -o keyletter more than once
(-o $option sub 1$ -o $option sub 2$ ... -o $option sub n$),
or by specifying a list of options with one -o keyletter
enclosed in double quotes (that is, -o "$option sub 1$
$option sub 2$ ... $option sub n$"). The standard interface
recognizes the following options:
nobanner
Do not print a banner page with this request. This
option is mutually exclusive with nomacheader. (The
administrator can disallow this option at any time.)
nofilebreak
Do not insert a form feed between the files given, if
submitting a job to print more than one file.
nomacheader
(For a system with DG/UX information security) Do not
print the MAC label that normally appears on the top
and bottom of each page. The MAC label still appears
on the front and back banners. This option is
mutually exclusive with nobanner.
macheader="label-string"
Print label-string in place of the MAC label that
normally appears at the top and bottom of each page.
The MAC label still appears on the front and back
banners. label-string must not contain blank
characters, as some printer interface programs have
difficulty parsing strings that contain blanks. An
underscore character, '_', may be useful as a
substitute for a blank.
length=scaled-decimal-number
Print this request with pages scaled-decimal-number
lines long. A scaled-decimal-number is an optionally
scaled decimal number that gives a size in lines,
inches, or centimeters, as appropriate. The scale is
indicated by appending the letter ``i'' for inches, or
the letter ``c'' for centimeters. For length
settings, an unscaled number indicates lines. For
example, length=66 indicates a page length of 66
lines, length=11i indicates a page length of 11
inches, and length=27.94c indicates a page length of
27.94 centimeters.
Note that the lp system will no longer automatically
adjust your font point size to accommodate additional
lines on a page. If you wish to print more lines than
a page can hold with the default font size, you must
now specify both -o length=<n> and -y ptsize=<m>.
This is in keeping with standard printing options on
other systems.
This option may not be used with the -f option.
width=scaled-decimal-number
Print this request with page-width set to scaled-
decimal-number columns wide. A scaled-decimal-number
is an optionally scaled decimal number that gives a
size in columns, inches, or centimeters, as
appropriate. The scale is indicated by appending the
letter ``i'' for inches, or the letter ``c'' for
centimeters. For width settings, an unscaled number
indicates columns. For example, width=80 indicates a
page width of 80 columns, width=8i indicates a page
width of 8 inches, and width=20.32c indicates a page
width of 20.32 centimeters.
This option may not be used with the -f option.
lpi=scaled-decimal-number
Print this request with the line pitch set to scaled-
decimal-number lines per inch. For line pitch
settings, an unscaled number indicates lines per inch
(the same as a number scaled with ``i''). For
example, lpi=6 indicates 6 lines per inch, lpi=6i also
indicates 6 lines per inch, and lpi=2.36c indicates
2.36 lines per centimeter.
This option may not be used with the -f option.
cpi=scaled-decimal-number
Print this request with the character pitch set to
scaled-decimal-number characters per inch. For
character pitch settings, an unscaled number indicates
characters per inch (the same as a number scaled with
``i''). For example, cpi=10 indicates 10 characters
per inch, cpi=10i also indicates 10 characters per
inch, and cpi=3.94c indicates 3.94 characters per
centimeter. Character pitch can also be set to pica
(representing 10 characters per inch) or elite
(representing 12 characters per inch), or it can be
compressed (representing as many characters as a
printer can handle). There is no standard number of
characters per inch for all printers; see the Terminfo
database [terminfo(4)] for the default character pitch
for your printer.
This option may not be used with the -f option.
stty='stty-option-list'
A list of options valid for the stty command; enclose
the list with single quotes if it contains blanks.
-P page-list
Print the pages specified in page-list. This option can be
used only if there is a filter available to handle it;
otherwise, the print request will be rejected.
The page-list may consist of range(s) of numbers, single page
numbers, or a combination of both. The pages will be printed
in ascending order.
-q priority-level
Assign this request priority-level in the printing queue.
The values of priority-level range from 0, the highest
priority, to 39, the lowest priority. If a priority is not
specified, the default for the print service is used, as
assigned by the system administrator. A priority limit may
be assigned to individual users by the system administrator.
-s Suppress messages from lp such as those that begin with
request id is.
-S character-set [-d any]
-S print-wheel [-d any]
Print this request using the specified character-set or
print-wheel. If a form was requested and it requires a
character set or print wheel other than the one specified
with the -S option, the request is rejected.
For printers that take print wheels: if the print wheel
specified is not one listed by the administrator as
acceptable for the printer specified in this request, the
request is rejected unless the print wheel is already mounted
on the printer.
For printers that use selectable or programmable character
sets: if the character-set specified is not one defined in
the Terminfo database for the printer [see terminfo(4)], or
is not an alias defined by the administrator, the request is
rejected.
When the -d any option is used, the request is printed on any
printer that has the print wheel mounted or any printer that
can select the character set, and that can handle any other
needs of the request.
-t title
Print title on the banner page of the output. The default is
no title. Enclose title in quotes if it contains blanks.
-T content-type [-r]
Print the request on a printer that can support the specified
content-type. If no printer accepts this type directly, a
filter will be used to convert the content into an acceptable
type. If the -r option is specified, a filter will not be
used. If -r is specified, and no printer accepts the
content-type directly, the request is rejected. If the
content-type is not acceptable to any printer, either
directly or with a filter, the request is rejected.
-w Write a message on the user's terminal after the files have
been printed. If the user is not logged in, then mail will
be sent instead.
-y mode
Print this request according to the mode listed. This option
may be used only if there is a filter available to handle it;
otherwise, the print request will be rejected. Several such
modes may be collected by specifying the -y keyletter more
than once (-y $mode sub 1$ -y $mode sub 2$ ... -y $mode sub
n$). The following modes are available.
All printers:
date Print the date on the top left corner of each
page. This mode uses the "%c" date(1) format.
date=string Print the date on the top left corner of each
page. The date string may be a literal or a
date(1) format.
title=string
Print a title centered at the top on the first
physical page. The title string may be multi-
lined using the \n token to denote line breaks.
heading=string
Print column headings at the top on all pages.
The columns headings string may be multi-lined
using the \n token to denote line breaks.
page_nums Print page numbers centered at the bottom of each
page.
PostScript printers:
portrait Print in portrait mode.
landscape Print in landscape mode.
group=num Print num logical pages (up to 9) per piece of
paper.
copies=num Print num copies of each page.
font=name Print using font name.
ptsize=num Print using point size num (default for portrait
is 10).
x=num Translate origin num inches along the positive x
axis (default is .25).
y=num Translate origin num inches along the positive y
axis (default is -.25).
magnify=num Magnify the logical page by the factor num.
HP Laserjet compatible printers:
timeout=num Notify the user if the printer is not accepting
data for num seconds. Printers stop accepting
data when off-line or in some fault condition.
By default, there is no timeout value (user is
never notified).
left=num Set left margin at column num.
right=num Set right margin at column num.
top=num Set top margin num lines from top of page.
bottom=num Set bottom margin num lines from top margin.
tray=name Use paper feeder name.
out=name Use output bin name.
form=name Print using form size name.
simplex Print in simplex mode.
duplex Print in duplex mode.
duplex-short
Print in duplex for short edge binding.
portrait Print in portrait mode.
landscape Print in landscape mode.
font=name Print using font name.
spacing=name
Select spacing mode name.
ptsize=num Print using point size num (default depends on
font).
style=name Select style type name.
weight=name Select font weight name.
raw Puts pagination filter into raw mode. Only
linefeed and formfeed characters are used to
determine pages. No line wrapping is performed,
and all characters (including control characters)
are passed through.
Line printers:
timeout=num Notify the user if the printer is not accepting
data for num seconds. Printers stop accepting
data when off-line or in some fault condition.
By default, there is no timeout value (user is
never notified).
left=num Set left margin at column num.
right=num Set right margin at column num.
bottom=num Set bottom margin to num lines.
htabs=num1,num2,...,numn
Set horizontal tabs at the columns specified in
the comma separated list. The list should be in
ascending order. A list of one number will set
horizontal tabs every num1 columns.
vtabs=num1,num2,...,numn
Set vertical tabs at the lines specified in the
comma separated list. The list should be in
ascending order.
tray=num Use alternate paper tray feeder num.
color=name Print in color name.
justify=mode
Set justification to mode (i.e. left, right,
full, center).
nlq Print in near letter quality mode.
normal Print in normal mode.
draft Print in draft mode.
bold Print in bold type.
shadow Print in shadow type.
proportional
Print with proportional spacing.
double_height
Print with double height characters.
ff Insert a formfeed character at the end of each
logical page.
raw Puts pagination filter into raw mode. Only
linefeed and formfeed characters are used to
determine pages. No line wrapping is performed,
and all characters (including control characters)
are passed through.
Canceling a Print Request
The cancel command cancels requests for print jobs made with the lp
command. The first form allows a user to specify one or more
request-IDs of print jobs to be canceled. Alternatively, the user
can specify one or more printers, on which only the currently
printing job will be canceled.
The second form of cancel permits a user to cancel all of his or her
own jobs on all printers. In this form the printers option can be
used to restrict the printers on which the user's jobs will be
canceled. Note that in this form, when the printers option is used,
all jobs queued for those printers will be canceled. A printer class
is not a valid argument.
Users without appropriate privilege can cancel only requests
associated with their own login IDs. For systems with DG/UX
information security, appropriate privilege is defined as having one
or more specific capabilities enabled in the effective capability set
of the user. See the cap_defaults(5) man page for the default
capabilities for this command.
On generic DG/UX systems, appropriate privilege means that your
process has an effective UID of root. See the
appropriate_privilege(5) man page for more information.
A user with appropriate privilege can cancel jobs submitted by any
user. The login-ID-list must be enclosed in quotes if it contains
blanks.
EXAMPLE
To print on a PostScript printer named pslaser an 8-bit-character
document named europe1 coded in ISO standard 8859.1 format:
lp -d pslaser -S iso-88591 europe1
FILES
/var/spool/lp/*
SEE ALSO
enable(1), epsonfx(1), lpstat(1), mail(1), postprint(1),
proprinter(1), laserjet(1), accept(1M), admlpsched(1M), lpadmin(1M),
lpfilter(1M), lpforms(1M), lpsched(1M), lpsystem(1M), lpusers(1M),
terminfo(4)a, appropriate_privilege(5), cap_defaults(5).
NOTES
The lp subsystem supports running with multiple lp schedulers. When
more than one lpsched is defined, each scheduler will appear as an
independent spooler with it's own set of printer queues, lp forms,
classes and user definitions. The lp command can operate with only
one lpsched at a time. To "target" a specific lpsched, the
environment variable DG_LPSCHED should be set to the desired lpsched
name before executing the lp command. If the DG_LPSCHED variable is
unset, then the default lpsched will be targeted. The currently
defined lpscheds can be listed with the admlpsched -o list command.
Printers for which requests are not being accepted will not be
considered when the lp command is run and the destination is any.
(Use the lpstat -a command to see which printers are accepting
requests.) On the other hand, if (1) a request is destined for a
class of printers and (2) the class itself is accepting requests,
then all printers in the class will be considered, regardless of
their acceptance status.
For printers that take mountable print wheels or font cartridges, if
you do not specify a particular print wheel or font with the -S
option, whichever one happens to be mounted at the time your request
is printed will be used. Use the lpstat -p printer -l command to see
which print wheels are available on a particular printer, or the
lpstat -S -l command to find out what print wheels are available and
on which printers. For printers that have selectable character sets,
you will get the standard character set if you don't use the -S
option.
Licensed material--property of copyright holder(s)