lp" -- Command" "

Spool a file for printing

llpp [[--dd_p_r_i_n_t_e_r]] [[--tt _t_i_t_l_e]] [[--nn_c_o_p_i_e_s]] [[--RR _p_a_g_e [[_p_a_g_e]]]] [[--SSmmwwss]] _f_i_l_e _._._.

The command lp spools text for printing. If you name no file on its command line, lp spools what it receives from the standard input.

lp prefaces the spooled text with a header that describes, among other things, on what device you want to print the text; then it copies the text into directory /usr/spool/mlp/queue, where it remains until it is removed by the printer daemon lpsched. The spooled text, which may comprise multiple files, plus its header is called a job.

The following describes the header with which lp prefaces each file:

  _O_f_f_s_e_t  _L_e_n_g_t_h  _D_e_s_c_r_i_p_t_i_o_n
     0      14    User who spooled the file
    14      14    Name of the printer on which to print file
    28      10    Type of file (application specific)
    38       3    Length of output page (default, 66 lines)
    41       4    Number of pages (maximum, 9,999)
    45       2    Number of copies to print (default, one; maximum, 99)
    47       1    Set life expectancy of job (see below)
    48       1    If `M', send user mail after printing
    49       1    If `W', write user after printing
    50      14    Name of data base (application specific)
    64      14    Name of program (application specific)
    78      10    Date/time stamp (no. of seconds since 1/1/1970)
    88      60    Description or title

Note that the fields marked ``application specific'' are not use by lp or lpsched. Rather, they are available to applications, such as filters, that may be used with lp to print files.

The ``life expectancy'' byte of the header defines how long the job remains alive in /usr/spool/mlp/queue. Jobs labeled TT (temporary) live for 30 minutes after being spooled; those labeled SS (short-term) live for 24 hours; and those labeled LL (long-term) live for 72 hours. Once a job's life expectancy has expired, the printer daemon lpsched removes it. The default is life expectancy is SS. To change the life expectancy of a job, use the command chreq. You can also change the above default ``lifetimes'' by editing the file /usr/spool/mlp/controls.

When lp creates a job, it gives the job a seven-character name. The name's first character gives the status of the job: R indicates that the file is being printed or is pending printing, whereas r indicates that the job has already been printed. The second character gives the job's priority status, from 0 through 9: zero gives highest priority, nine the lowest. The default priority is 2. The last five characters of the name give a zero-padded sequence number. To change a job's status or priority, use the command chreq; or the system administrator can alter either simply by renaming the file.

lp recognizes the following options:

--RR _r_e_q_u_e_s_t
Print a job beginning from the first _p_a_g_e and continuing either to the second _p_a_g_e or to the end of the document (if no second _p_a_g_e is specified). Note that the printer daemon lpsched identifies pages by counting lines of input, so this feature works only with straight text. It does _n_o_t work correctly with ``cooked'' input, such as files of PostScript or PCL.

--SS9
Shut down the spooler daemon llppsscchheedd.

--dd_p_r_i_n_t_e_r
Print the job on _p_r_i_n_t_e_r.

--mm
Send mail to the user once the spooled job has been printed.

--nn_c_o_p_i_e_s
Print _c_o_p_i_e_s copies of the job.

--ss
Silent -- do not acknowlege submissions. Normally, lp writes on the standard output the sequence number of the job you just spooled. You can use that number to remove or abort a job, or otherwise manipulate it.

--tt _t_i_t_l_e
Give this job _t_i_t_l_e. This is the title that appears in the queue displayed by the command lpstat.

--ww
Write a message on the user's screen once the job has been printed.

lp sends you mail if one of your print jobs failed due to an error.

For more information on lp and its related commands, see the Lexicon entry printer.

See Also

Notes

Because most users find banners annoying rather than helpful, lp does not print banners. It ignores the option -b, which under orthodox implementations of lp prints a banner page. Applications that desire a banner page should make provision for it in the individual printer's control file. For details, see the Lexicon entry for the command lpadmin.

A If you wish to use lp to download a PCL bitmapped font to your PCL printer, you must first process the font with the command pclfont. For details, see its Lexicon entry.