CSS Unitec Home Page
      

Spooler Frontend

 lpr(U)

Synopsis   Platforms   Description   Options   Notes   Files   See also

Synopsis

lpr [option]... [file...]

Platforms

Unix, Windows NT

Description  

The lpr command arranges for the named files and associated information to be printed. If no 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 using the file name '-'. The intermediate spool files are compressed by lpr and will be uncompressed by the despooler daemon lpd upon printout.

Options

-a

Automatic setting of the character pitch (CPI) for the longest line in the document to fit onto the current form.

-b text Set banner page id to text.
-c n Set number of copies to print to n (default 1). An entry of 0 (zero) will cause the report to remain in the queue and to be printed only after it has been released by the user through the csu or css program (report in 'hold' state, see also H-option). The option value will then however be set to the default value of 1, i.e. -c 0 is identical to -H -c 1.
-d dev Print report on device dev. You may specify dev as logical device number (0..999) or as device name (see dn-parameter in css.devices(C)). A device number of 0 does not assign a specific printer and causes CSS to route the report to any available system printer (see as-parameter in css.devices(C)) that has the requested form mounted. If this option is missing, the device is taken from the entry default_device in CSS.DEFAULT(C), which itself defaults to 0.
-e mkz Set employee-id to id (up to 8 characters, default login name). The employee-id will show in status queries through csu and css.
-f f[:s] Set form type of the printout to f. All form names are case insensitive. The optional form subtype s (up to 3 characters) may be used as ordering value as described in css.devices(C) (box- and eox-parameters). The subtype is not used by CSS. If this option is missing, the form is taken from the entry default_form in CSS.DEFAULT(C), which itself defaults to A.
-g group Set the group id to group (name or ID). The default is to set the report group-id to the gid found in the /etc/passwd entry of the user creating the report or the user specified in the u-option.
-h Suppress printing of banner pages.
-k date Keep report in the print queue until date. The user may however delete the report at any time manually through csu and css.
-p pgm Set program name to pgm (up to 14 characters). The program name will show in status queries through csu.
-r dev Use device dev for report routing (default 0, see special notes below).
-t tit Set report title to title. The report title will show in status queries through csu and css. The t-option is active for the first file named in the command line only. The default title for all files is the name listed in the file list and '(pipe)' for standard input.
-u user Set user id to user. If no e-option has been specified this will also set the employee id to user. The option value may be entered as Unix user id or user name and must be defined in /etc/passwd.
-B mode This option will cause CSS to print the report in binary mode (i.e. without escape- and tr-translation) even if the target printer has not been defined as binary device (bm-parameter). The use of this option requires the definition of a device through the d- or r-option. After binary reports have been added to the report queue, they may only be routed to devices with the same device type defined (dt-parameter in css.devices(C)). Mode is constructed by adding numeric values and determines the output of the initialization and termination control sequences that have been defined for the target device (see also css.devices(C)). Each value that is included in mode will cause the corresponding control string to be sent to the printer. The following values are defined:
10 bor 01 eor
20 if1 02 tf1
40 if2 04 tf2
-C cond Set condition flags cond to the true state. Condition flags may be used to control activation of conditional bor-, eor-, bop-, eop-, bol-, eol- and tr-control strings (see css.devices(C)). Cond may be entered as a sequence of digits and letters (case sensitive) or as argument list as in a,b,c,B,1. Multiple C-options are allowed.
-H Set report to the 'hold' state (see also c-option). This will cause the report to remain in the queue and to be printed only after it has been released by the user through the csu or css program.
-K ndays Keep report in the print queue for ndays days. The user may however delete the report at any time manually through csu and css.
-L lang Set the language ordering value to lang (up to 14 characters). This value may be used to control the generation of language specific initialization and termination filenames in the box- and eox-parameters in css.devices(C) (see also fdu).
-O ord Set the user ordering value to ord (up to 60 characters). This value may be used to control the generation of initialization and termination filenames in the box- and eox-parameters in css.devices(C) (see also fdu).
-P n Set the page size of the named reports to n lines. Normally lpr will determine the number of pages in a report by using the ps-parameter of css.forms(C) and the number of linefeeds and form feeds in the document. This information enables the user to plan the paper requirements or to cancel and reschedule the printout from a given page. Since the use of fdu-macros and/or box control strings may redefine the number of lines per page to a value that differs from the ps-parameter, the number of pages determined may be incorrect. The use of the P-option will allow to correct these errors. A value of 0 (zero) will cause lpr to only consider form feeds to determine the number of pages in the document. For a complete discussion of this option, see the notes below.
-S esc Insert the CSS escape sequences esc at the beginning of the first page printed before bop (reminder: Start). These control strings will be translated to the values defined in the corresponding ex-parameters in css.devices(C) of the target device. Esc may be entered as argument list as in e5,e7,e30 (short format: 5,7,30). Multiple S-options are allowed.
-T esc Add the CSS escape sequences esc at the end of the last page printed after eop (reminder: Terminate). These control strings will be translated to the values defined in the corresponding ex-parameters in css.devices(C) of the target device. Esc may be entered as argument list as in e5,e7,e30 (short format: 5,7,30). Multiple T-options are allowed.
-- May be used to indicates the end of the options. This allows you to enter file arguments with names beginning with the character '-'.

Notes

To calculate the line length of a document (a-option), lpr assumes tab positions at 9, 17, 25, and so on. Since changes of the line length through character translations (tr-parameter in css.devices(C)) happen at the time of the printout, they will not be taken into account.

The calculation of the number of pages in a document is dependent of several definitions and options. In normal operation, the ps capability of the form description in css.forms(C) defines the number of lines per page. This value may be overwritten by a positive, non zero P-option. An input page break occurs, whenever a formfeed character is encountered or the number of lines per page has been reached. A P-option value of zero (0), causes CSS to assume variable form length, where only formfeed characters trigger an input page break.

In a similar manner, the top of form processing of the lpd despooler daemon is controlled by multiple definitions and options. Again the ps capability of the form description or a positive, non zero P-option define the number of lines per page. Each page is preceded by the bop sequences and terminated by the eop sequences. An output page break occurs whenever a formfeed character is encountered or the number of lines per page are reached, i.e. a page overflow occurs. If the pg (page printer) flag has not been set for the device (css.devices(C)), the formfeed characters are not transmitted to the printer. Top of form positioning is accomplished by inserting the necessary number of empty lines. If however the pg flag is set, no empty lines will be generated and formfeeds are transmitted to the device. Page overflows do not insert an extra formfeed. The last page is guaranteed to be terminated with a formfeed. If each page should be terminated with a ff character, the :eop -f=...\f...: definition may be used. In either case, a P-option value of zero (0), causes CSS to assume variable form length, and page overflows do not trigger an output page break.

The use of -P 0 generates a potential problem. The variable $ (i.e. ‘last line’ as in :eol ($-3)=...:) is determined relative to the page size of the form definition (ps capability) and may thus be missing or out of sequence on pages with variable number of lines.

If a printer port cannot be opened, it will be put into the 'hold' state. On some system this will also happen with parallel ports, if the printer is 'off-line'.

Lpr options may be also defined in the file $HOME/.lprrc as well as in the shell environment variable LPROPT. The evaluation order is described in the section 'Syntax of Command Lines' page 1-7.

For compatibility reasons, the shell environment variable CSS is still supported. It is evaluated before the remote control file $HOME/.lprrc and has thus the lowest priority. We recommend however the use of the standard variable LPROPT. As an example, to always use the a-option, and to route output to device 2, you may enter the following command in your .profile:

LPROPT="-a -r 2"; export LPROPT;

or in the file $HOME/.lprrc:

-a -r 2

The lpr options are scanned in the following order:

1. CSS shell environment variable
2. File $HOME/.lprrc
3. LPROPT shell environment variable
4. lpr command line
5. options embedded in the document


Thus the options in the remote control file have the lowest and the document embedded controls have the highest priority.

There are different ways to select a output device:

  • If the selected form class designates a particular output device (ld-parameter in css.forms(C)), the given device is selected. There is no way to overwrite this setting.
  • The use of the d-option follows the priority schema outlined above.
  • If the r-option is set and no printer has been assigned by the rules above, the device given in the option is used for printout.

Files

Css:

/etc/css.banner Banner page messages
/usr/lib/css/css.errlog Despooler daemon error log
/usr/lib/css/lpd Despooler daemon
/usr/lib/css/dev Device Database
/usr/lib/css/forms Forms Database
/usr/lib/css/rep Report Database
/usr/spool/css/* Spool Area
 
CssNT:
etc\css.banner Banner page messages
lib\CssErrlog.txt Service error log
lib\CssNTSrv.exe Service program (despooler)
lib\dev Device Database
lib\forms Forms Database
lib\rep Report Database
spool\* Spool Area

See also

csa, css, csu, cssdate, css.devices(C), fdu, lpdrestart, pr(1)

 

Back to top