Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ lp(C) — OpenDesktop 2.0.0a

Media Vault

Software Library

Restoration Projects

Artifacts Sought


 lp(C)                           19 June 1992                           lp(C)


 Name

    lp - send requests to lineprinter

 Syntax

    lp [ options ] files lp -i request-id [ options ]

 Description

    The first form of the lp shell command arranges for the named files and
    associated information (collectively called a request) to be printed.  If
    no filenames 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 specifying the files as arguments to lp before the
    standard input.  The files will be printed in the order they appear on
    the command line.

    The second form of lp is used to change the options for a request.  The
    print request identified by the request-id is changed according to the
    printing options specified with this shell command.  The printing options
    available are the same as those with the first form of the lp shell com-
    mand.  If request-id has finished printing, the change is rejected.  If
    request-id is already printing, it will be stopped and restarted from the
    beginning, unless the -P option has been given. This form of lp can not
    be used to change the options for a remote printing request.

    lp associates a unique id with each request and prints it on the standard
    output.  This id can be used later to cancel, change, or find the status
    of the request.  (See lpstat(C) for information about checking the status
    of a print request.)

    For remote printing, lp only supports -d, -n, and -t options.

    Options to lp must always precede filenames but may be listed in any
    order.  The following options are available for lp:

    -c          When lp runs, it immediately creates a copy of the files
                specified for printing. The copies are subsequently printed.
                Changes made to a file after the lp command is issued but
                before the file is printed will therefore not be reflected in
                the printed output.  Versions of lp in earlier releases did
                not create a copy of the print files unless the -c flag was
                used (to indicate that copies of the print files should be
                made).  Because this is now the default behaviour for lp,
                this flag is retained solely for backward compatability, and
                need not be used.

    -d dest     Prints this request using dest as the printer or class of
                printers.  Under certain conditions (lack of printer availa-
                bility, capabilities of printers, and so on), requests for
                specific destinations may not be accepted (see accept(ADM)
                and lpstat(C)).  By default, dest is taken from the environ-
                ment 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(C)).

    -f form-name [ -d any ]
                Prints the request on the form form-name.  The LP print ser-
                vice 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(ADM)).
                When the -d any option is given, the request is printed on
                any printer that has the requested form mounted and can han-
                dle all other needs of the print request.

    -H special-handling
                Prints the request according to the value of special-
                handling.  Acceptable values for special-handling are hold,
                resume, and immediate, as defined below:

    hold        Will not print the request until notified.  If already print-
                ing, stops it.  Other print requests will go ahead of a held
                request until it is resumed.

    resume      Resumes a held request.  If it had been printing when held,
                it will be the next request printed, unless subsequently
                overridden by an immediate request.

    immediate   (Available only to LP administrators)
                Prints 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          Sends mail (see mail(C)) after the files have been printed.
                By default, no mail is sent upon normal completion of the
                print request.

    -n number   Prints number copies of the output (default is 1).

    -o option   Specifies printer-dependent or class-dependent options.
                Several such options may be collected by specifying the -o
                keyletter more than once.  The standard interface recognizes
                the following options:

    nobanner    Does not print a banner page with this request.  (The
                administrator can disallow this option at any time.)

    nofilebreak Does not insert a form feed between the files given if sub-
                mitting a job to print more than one file.

    length=scaled-decimal-number
                Prints the output of 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,
                columns, inches, or centimeters, as appropriate.  The scale
                is indicated by appending the letter ``i'' (for inches) or
                the letter ``c'' (for centimeters).  For length or width set-
                tings, an unscaled number indicates lines or columns; for
                line pitch or character pitch settings, an unscaled number
                indicates lines per inch or characters per inch (the same as
                a number scaled with ``i'').  For example, length=66 indi-
                cates 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.

                This option cannot be used with the -f option.

    width=scaled-decimal-number
                Prints the output of this request with page-width set to
                scaled-decimal- number columns wide.  (See the explanation
                above for scaled-decimal-
                numbers.)  This option cannot be used with the -f option.

    lpi=scaled-decimal-number
                Prints this request for ``lines per inch'' with the line
                pitch set to scaled-decimal-number lines per inch.  This
                option cannot be used with the -f option.  TP 12 cpi=scaled-
                decimal-number Prints this request for ``characters per
                inch'' with the character pitch set to scaled-decimal-number
                characters per inch.  Character pitch can also be set to pica
                (representing 10 columns per inch) or elite (representing 12
                columns per inch), or it can be compressed, to print as many
                columns as the printer can handle.  There is no standard num-
                ber of columns per inch for all printers; see the terminfo(F)
                database for the default character pitch for your printer.
                The cpi option cannot be used in conjunction with the -f
                option.

    stty=stty-option-list
                Set the printer with a list of options valid for the stty
                command.  Enclose the list with quotes if it contains blanks.

    -P page-list
                Prints the page(s) 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
                Assigns this request priority-level in the printing queue.
                The values of priority-level range from 0, the highest prior-
                ity, to 39, the lowest priority.  If a priority is not speci-
                fied, the default for the print service is used, as assigned
                by the system administrator.

    -s          Suppresses messages from lp(C) such as ``request id is ...''.

    -S character-set [ -d any ]

    -S print-wheel [ -d any ]
                Prints this request using the specified character-set or
                print-wheel.  If a form has been specified that 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 accept-
                able for the printer involved 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(F)) 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 can handle all other needs
                of the request.

    -t title    Prints title on the banner page of the output.  The default
                is no title.

    -T content-type [ -r ]
                While the printer type information tells the print service
                what type of printer is being added, the content type infor-
                mation tells the print service what types of files can be
                printed.  Prints 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 but 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          Writes a message on the user's terminal after the files have
                been printed.  If the user is not logged in or the terminal
                cannot be written to (mesg is n), then mail will be sent
                instead.

    -y mode-list
                Prints this request according to the printing modes listed in
                mode-list.  The allowed values for mode-list are locally
                defined.  This option can be used only if there is a filter
                available to handle it; if there is no filter, the print
                request will be rejected.

    -R          Removes file after sending it.

    -L          Local printing option. Sends print job to printer attached to
                the terminal.

    The file /etc/default/lpd contains the setting of the variable BANNERS,
    whose value is the number of pages printed as a banner identifying each
    printout.  This is normally set to either 0 or 1.

    The variables LPR and PRINTER can each be set to `spooler' or `local'.
    These variables let you send files to the spool printer or the terminal's
    local printer, respectively.  The file /usr/bin/spool contains the
    `spooler' setting for both variables.  The file /usr/bin/local contains
    the `local' setting.  The following are a few examples of variable usage:

       lp -option spooler
       LPR=local
       LPR=spooler
       spool lp -option device file

    Printers for which requests are not being accepted will not be considered
    when the destination is any.  (Use the lpstat -a command to see which
    printers are accepting requests.)  On the other hand, if a request is
    destined for a class of printers and the class itself is accepting
    requests, all printers in the class will be considered, regardless of
    their acceptance status, as long as the printer class is accepting
    requests.

    lpr is a link to lp. These names may be used interchangeably.  For print-
    ers that take mountable print wheels or font cartridges, if you do not
    specify a particular print wheel or font with the -S option, whichever
    happens to be mounted at the time your request prints will be used.  Use
    the lpstat -p -l command to see what print wheels are available.  For
    printers that have selectable character sets, you will get the standard
    set if you don't give the -S option.

 Files

    /usr/spool/lp/*
    /etc/default/lpd
    /usr/spool/lpd
    /etc/printcap
    /etc/hosts.equiv

 See Also

    accept(ADM), cancel(C), enable(C), lpadmin(ADM), lpfilter(ADM),
    lpforms(ADM), lpsched(ADM), lpstat(C), lpusers(ADM), mail(C), terminfo(F)

 Standards conformance

    lp is conformant with:

    AT&T SVID Issue 2;
    and X/Open Portability Guide, Issue 3, 1989.


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