Module 81 lpr (BSD)

Previous Table of Contents Next


Module 81
lpr (BSD)

DESCRIPTION

The external lpr command spools print jobs to a specific printer s spool queue for later printing by a printer daemon. The printer daemon provides a mechanism for many users to share one device. The daemon knows when the printer is busy and when it is available. The printer queue is a directory with data and control files which make up a print job. The daemon searches for the oldest control file and sends the data file to the printer device based on parameters in the control file.

The system is set up with a default printer destination. If you do not specify a printer destination, your files are sent to the system default. You can override the system default by defining the PRINTER variable in your shell environment. Typically, BSD uses the csh , so the command to set the variable is

 setenv PRINTER lj 

For sh and ksh the command is

 export PRINTER=lj 

This will cause your files to be printed on the lj printer instead of the system default printer if you do not specify a printer.

If you wish to send a file to a printer other than the system default or your default PRINTER, you simply use the -P printer option on the lpr command line.

To list out all available printers type lpc status and press Return . The lpc command is used by the system administrator to control the printer daemons and queues.

COMMAND FORMAT

Following is the general format of the lpr command.

 lpr [ -cdfghlmnprstv ] [ -#num ] [ -1234 font ] [ -C class ]          [ -J job ] [ -P printer ] [ -T title ] [ -i[num] ] [ -wnum ]          [ file_list ] 

Options

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

The following options are used by lpr to notify the spooling daemon that the input files are not standard ASCII text files. The spooling daemon reads this information from the job control file and uses the appropriate filters to print the data files.

-c Assume the data is output from ciplot .
-d Assume the data is in DVI (Stanford) format.
-f Use a FORTRAN filter which interprets the first character of each line as a standard FORTRAN carriage control character.
-g Assume the data is output from plot routines. The data is in plot format.
-l Uses a filter which displays control characters as ^X and suppresses form feeds (page breaks).
-n Assume the data is output from ditroff (device independent troff).
-p Use pr to format the data (same as the BSD print command).
-t Assume the files contain data from troff (phototypesetter command).
-v Assume the data is raster image format.

The -c, -d, -f, -g, -l, -n, -t, -v require a special filter to work. The system administrator must define each of these filters in the printcap file.

The following options control how lpr performs simple formatting and other functions.

-h Suppresses the printing of the burst (cover) page.
-m Sends mail to you upon completion of the printing.
-r Remove the file after the job has been spooled. If the -s option is used, remove the file after it is has been printed.
-s Use a symbolic link. Usually files are copied to the spool directory. A symbolic link creates a new file with the same name in the spool directory, which is only a link to the original file.
-# num Prints multiple copies of output. Where num is the number of copies of each file to print.
-1234 font Specifies a font to mount in position X, where X is 1 through 4. Fonts are in /usr/lib/vfont. Fonts are vendor or site dependent and printer dependent so trial and error is required.
-C class Prints class as a job classification on the burst page.
-J job Prints job as the job name on the burst page.
-P printer Specifies the destination printer. The output is printed on printer printer.
-T title Forces pr to use title as the head title instead of the file name.
-i[ num ] Indent the output num columns . If num is not given, the indention is eight spaces.
-w num Uses num as the page width for pr .

Arguments

The following describes the argument that may be passed to the lpr command.

file_list The list of files to print.
If no files are listed the standard input is printed.


Previous Table of Contents Next

Copyright Wordware Publishing, Inc.


Illustrated UNIX System V
Illustrated Unix System V/Bsd
ISBN: 1556221878
EAN: 2147483647
Year: N/A
Pages: 144
Authors: Robert Felps

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net