Previous Table of Contents Next

Module 79
lp (SV)


The external lp command spools output to a printer queue. Spooling is the sending of output to a temporary storage area for later processing by the printer subsystem. The output may be a list of files or the standard input passed to the lp command. The lp command "wraps" the output into a print request and assigns a print job ID. A print job consists of a control file and the output to be printed.

The features of having a spooling subsystem are provided by lp. The following list outlines these features:

*  Spool multiple print jobs to printers without waiting.
*  Spool jobs to multiple printers.
*  Specify the number of copies to be printed.
*  Specify options to the driver scripts that perform the actual printing.
*  Change the title of the banner page on the printout.
*  Notification of your request upon completion via mail or write.


Following is the general format of the lp command.

     lp [ - ] [ -cmsw ] [ -ddest ] [ -f form [ -d any ] ] [ -H req_type ] \
       [ -nn ] [ -ooption ] [ -P page_list ] [ -q priority_list ] \
       [ -S char_set [ -d any ] ] [ -S print_wheel [ -d any ] ] [ -ttitle ] \
       [ -T type [ -r ] ] [ -y mode_list ] file_list


The following list describes the options and their arguments that may be used to control how lp functions.

- Read from the standard input. This allows you to read from the standard input and from files.
-c Copy files to lp request directory instead of linking. Normally lp tries to link to the files if possible. If you do not use the -c option and a link is created to your files, you must not remove any of the files until the request has finished printing. Any changes to linked files will be reflected in the current print request output.
-m Send mail back to you after the files have been printed. Usually no mail is sent upon successful completion of your print request.
-s Suppress response messages from lp. Such messages as,
      "request id is printer-957"
are not displayed on your terminal for each request.
-w Writes a message to your terminal when your print request has completed printing. If you are no longer logged in, mail is sent.
-ddest Specify desired destination printer. If your system has multiple printers available for printing, you can select the printer of your choice. The destination dest may specify a class of printers. If this is the case, your request will print on the first available printer in the class. If a printer is disabled or no disk space is available to store the request, lp will not accept the request for the dest printer. If you have the LPDEST variable set, lp will use its value for the destination printer. If you do not have LPDEST set and do not specify a destination printer, lp uses the system default printer. Set LPDEST by typing LPDEST=printer and export LPDEST. If you want this done each time you log in, place these commands in your .profile file.
-fform [ -d any ] Print the request on the predefined form named form. If the form form is not supported on the destination printer, the request is rejected. Forms must be defined by the system administrator using lpforms. If -d any is used, the request is sent to any printer that supports the specified form.
-Hreq_type Print the request according to the req_type. Valid req_types are;
hold Hold the request until resumed. Requests already printing are stopped. Other requests will continue to print.
resume Resume a held request. If the request was printing when it was held, it will print next, unless bumped by an immediate request.
immediate Print the request immediately, which means after the current request finishes printing. Only available to the lp admin- istrator account.
-nn Print n copies of the request. If -nn is not given, one copy is printed.
-ooption Specify printer or class dependent options. The option is passed to the driver script for the given destination. To specify multiple printer options use the -ooption notation repeatedly. Your system administrator or the printer vendor sets up the driver scripts. Ask your system administrator for a list of supported options. The default SVR4 interface understands the following options;
nobanner Suppress the banner page. The lp administrator can disallow this option at any time.
nofilebreak If more than one file is to be printed, do not insert a formfeed between each file.
length=n Print the request n lines long. Where n is one of the following;
ni Page length of n inches.
nc Page length of n centimeters.
n Page length of n lines.
Not usable with the -f option.
width=n Print the request n columns wide. Where n is one of the following;
ni Page width of n inches.
nc Page width of n centimeters.
n Page width of n columns.
Not usable with the -f option.
lpi=n Print the request with line pitch set to n lines per inch.
Not usable with the -f option.
cpi=n Print the request with character pitch set to n characters per inch. Other values for n are;
pica 10 coloums per inch.
elite 12 coloums per inch.
compressed As many coloums as the printer can handle
Not usable with with -f option.
stty=options A list of valid stty command options. If more than one option is specified, separate with spaces and enclose in double quotes.
-Ppage_list Print the specified pages. A filter capable of printing certain pages must be available if one is not the request is rejected. The page_list can be single pages, ranges(pN-pM), or a combination of both.
-qpriority_level Assign current request the specified priority. The priority_level can be 0 to 39, with 0 being the highest priority. The default priority assigned to a request is set by the lp administrator.
-Schar_set [ -d any ]
-Sprint_wheel [ -d any ]
Print the request using the specified char_set or print_wheel. If the char_set or print_wheel is not supported by the requested printer, the request is rejected. If a form is also specified that requires a different char_set or print_wheel, the request is rejected.
The allowable char_sets and print_wheels are set up by you local lp administrator.
If -d any is used, the request is sent to any printer that supports the specified form.
-ttitle Prints the title string on the banner page of the printout.
-Ttype [ -r ] Print the request on a printer that supports the specified content type. If no printers support the content type, the request is filtered into an acceptable type. If no filter is available or the -r option is specified, the request is rejected.
-ymode_list Print the request according to the specified modes. The values of mode_list are locally defined. If a specified mode is not supported, the request is rejected.

Previous Table of Contents Next