Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

enable(1)

lpstat(1)

mail(1)

slp(1)

accept(1M)

lpadmin(1M)

lpana(1M)

lpsched(1M)

mklp(1M)

rcancel(1M)

rlp(1M)

rlpdaemon(1M)

rlpstat(1M)

lp(1)

NAME

lp, cancel, lpalt − send/cancel/alter requests to an LP line printer or plotter

SYNOPSIS

lp [−c] [−ddest] [−m] [−nnumber] [−ooption] [−ppriority] [−s] [−ttitle] [−w] [files ...]

cancel [ids] [printers] [−a] [−e] [−i] [−uuser]

lpalt id [−ddest] [−i] [−m] [−nnumber] [−ooption] [−ppriority] [−s] [−ttitle] [−w]

DESCRIPTION

lp arranges for the named files and associated information (collectively called a request) to be printed by a line printer or supported plotter. If no file names are specified, standard input is assumed. The file name − specifies standard input and can be supplied on the command line in conjunction with named files. The order in which files appear is the same order in which they will be printed or plotted. 

lp associates a unique ID with each request and prints it on the standard output.  This ID can be used later to cancel (see cancel), alter (see lpalt), or find the status (see lpstat(1)) of the request.

lp recognizes the following options which can be specified in any order prior to the file names.  Blanks are not currently allowed between an option and its corresponding argument. 

−c Make copies of the files to be printed immediately when lp is invoked.  Normally, files are linked into a spool directory.  Ownership and mode of the linked files remains unchanged.  If the −c option is given or linking is not possible the files are copied, in which case the ownership and mode are set to allow read access to owner lp and group bin only.  It should be noted that if the files are linked rather than copied, any changes made to the named files after the request is made but before it is printed will be reflected in the printed output.  The standard input is always copied instead of linked. 

−ddest Choose dest as the printer or class of printers that is to do the printing.  If dest is a printer, the request will be printed only on that specific printer.  If dest is a class of printers, the request will be printed on the first available printer that is a member of the class.  Under certain conditions (printer unavailability, file space limitation, etc.), requests for specific destinations might not be accepted (see accept(1M) and 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)).

−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.

−nnumber Print number copies (default of 1) of the output. 

−ooption Specify printer-dependent or class-dependent options. Several such options can be collected by specifying the −o keyletter more than once.  For more information about what options are valid for printers supported on your system, see the particular model script in /usr/spool/lp/model associated with the specified printer. 

−ppriority Give priority to the print request.  This parameter is used to select next spooled file for the targeted printer or class of printers.  priority must be in between 0 (lowest priority) and 7 (highest priority).  If the value is less than fence (see lpfence(1M)), the print request is deferred. Default is the default priority set by lpadmin(1M) of the printer when printer is specified for dest, and is the highest default priority among printers of the class when class is specified for dest.

−s Suppress messages from lp such as "request ID is ...". 

−ttitle Print title on the banner page of the output. 

−w Write a message on the user’s terminal after the files have been printed.  If the user is not logged in or rlpdaemon(1M) is not running on local system for remote printing, then mail will be sent instead. 

cancel cancels line printer requests that were made by the lp command.  At least one id or printer must be specified. 

ids Specify a request id (as returned by lp) for a local printer. This cancels the associated request even if it is currently printing. Specifying a request id (as returned by lp) for a remote printer cancels the associated request if it is owned by the user, even if it is currently printing.

printers Specify the names of printers (for a complete list, use lpstat(1)). Specifying a local printer cancels the request currently printing on that printer. Specifying a remote printer cancels the request currently printing on that printer if it is owned by the user. If the −a, −e or the −u option is specified, this option specifies the printer on which to perform the cancel operation. 

−a Remove all requests a user owns on the specified printer (see printers). The owner is determined by the user’s login name and host name on the machine where the lp command was invoked. 

−e Empty the spool queue of all requests for the specified printer (see printers). Only users with appropriate privileges can use the −e option. 

−i Cancel only local requests. 

−uuser Remove any requests queued belonging to user.  Multiple −u options are allowed.  Only users with appropriate privileges can use the −u option. 

In any case, the cancellation of a request that is currently printing frees the printer to print its next available request. 

lpalt alters a line printer request made by a previous lp command.  A new unique ID is returned to the standard output. 

id Specify a request id (as returned by lp) for a local printer. This alters the associated request only if it is not currently printing. Specifying a request id (as returned by lp) for a remote printer alters the associated request if it is owned by the user, only if it is not currently printing.

−i Alter only local requests. 

HP Clustered Environment

In the HP Clustered Environment, all spooling is handled as if the cluster nodes were a single system and all printers attached to either the cluster server or clients can be available.  Remote spooling applies to spooling from or to machines outside of the cluster nodes. 

EXTERNAL INFLUENCES

Environment Variables

LANG determines the language in which messages are displayed. 

If LANG is not specified or is set to the empty string, a default of "C" (see lang(5)) is used instead of LANG. 

If any internationalization variable contains an invalid setting, lp and cancel behave as if all internationalization variables are set to "C".  See environ(5).

International Code Set Support

Single- and multi-byte character code sets are supported. 

RETURN VALUE

Exit values are:

 0 Successful completion. 

>0 Error condition occured. 

EXAMPLES

Assuming there is an existing HP2934A line printer named lp2, configured with the hp2934a model interface program.  This model has the −c option which causes the printer to print in a compressed mode.  To obtain compressed print on lp2, use the command:

lp  −dlp2  −oc  files

WARNINGS

A remote print request can be cancelled only by the user who requested it, and only on the system from which the request was spooled. 

If the restrict cancel feature (selected by −orc in lpadmin(1M)) is enabled for the specified printer, a user can only cancel/alter requests owned by the user.

For remote system, lpalt cannot change dest and priority. 

FILES

/usr/spool/lp/∗

SEE ALSO

enable(1), lpstat(1), mail(1), slp(1), accept(1M), lpadmin(1M), lpana(1M), lpsched(1M), mklp(1M), rcancel(1M), rlp(1M), rlpdaemon(1M), rlpstat(1M). 

STANDARDS CONFORMANCE

lp: SVID2, XPG2, XPG3, proposed POSIX.2 FIPS (June 1990)

cancel: SVID2

Hewlett-Packard Company  —  HP-UX Release 8.05: June 1991

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026