Guide to Printing with lpr
lpr is used to print text or PostScript files to printers.
This UNIX command has been ammended on all SGI workstations to
include several default options and profide a simple menu interface.
The reconfigured lp command has three options:
- Type lpr. The workstation will show you a roster of
printers available from your workstation and prompt
you for the name or number of the printer and the name of the file.
The file must be a text or PostScript file.
- Use the standard lpr command. For example,
type lpr filename to print filename;
using the default printer for your workstation
(type setenv | grep PRINTER to list the default printer).
ALL lpr options are supported.
Type "man lpr" for details.
- Type "lpr help" to read more about lpr.
Notes about the amended lpr command
The lpr wrapper script solves the following problems:
- Many printers in the Department of Chemistry have a network port. Workstations
can send print jobs directly to these printers. The workstation must
also inform the printer if the print job is
"raw" (for PostScript) or "text" (for text). The workstation sends this
job type information to the printer by printing to printername_ps or
printername_text. Knowing when to specify the job type ("raw" or "text",
by specifying "_ps" or "_text" in the printer name) can sometimes be difficult.
The lpr wrapper determines if your print job is PostScript or text.
- Some workstations do not have a network port. To print to these
printers, a workstation must send the print job to another workstation,
which then sends the print job to the printer via a parallel port cable.
Knowing if the printer is accessed via another workstation can sometimes
be difficult. The lpr wrapper takes care of this automatically.
- The list of printers available to a workstation is different for each
workstation. Also, printers need to be taken out of service for occasional
maintenance. Keeping track of which printer is avaialable to the
workstation that you are using at a particular moment can be difficult.
- The fold command divides lines that are longer than
80 characters into
2 or more lines that are less than 80 characters. This is a very
convenient command to use when printing text files that have lines
with greater than 80 characters. Also, it's usually not necessary to print
the "banner" or "header" page, which just wastes paper. The lpr wrapper
folds text and avoids printing the banner page.
- Finally, printing costs money. Therefore, printing accounting is required.
The lpr wrapper logs print jobs and number of pages printed.
You can still use lpr as if there was no wrapper. All arguments to lpr
will be passed to the lpr spooler. However, users who use lpr with
arguments do so at their own risk. Type man lpr for more information
about the lpr arguments. The following arguments are most popular:
- -h turns off printing of the banner or header page.
- -Pprintername prints to printer printername.
- -#num prints num copies.
Note that you can still use the lpr.UNIX program. However,
this is strongly discouraged, since it bypasses the wrapper's printer
acocunting. The standard UNIX printer accounting is also used, which cannot be
bypassed. The standard accounting doesn't log the number of pages printed,
so the wrapper's printer accounting is our primary printer accounting log.
Since it's easy to automatically compare the standard UNIX
printer accounting with the wrapper's printer accounting, users who bypass
the wrapper's printer accounting by using lpr.UNIX will be caught.
SYSTEM ADMINISTRATOR'S NOTES
The lpr script is
located in /usr/bsd, and the standard lpr UNIX program has been renamed
to /usr/bsd/lpr.UNIX. A copy of the lpr wrapper script is located at
/usr/bsd/lpr.copy. If you install lpr
software, you must type
mv /usr/bsd/lpr /usr/bsd/lpr.UNIX; cp /usr/bsd/lpr.copy /usr/bsd/lpr
to reinstall the lpr wrapper.
The lpr script also needs 3 awk scripts in /usr/bsd:
These awk scripts insert special text into a PostScript file so that the
printer will automatically recognize which paper tray should be used.
Specifically, the lpr_8x11.awk and lpr_11x17.awk scripts select the 8x11 or 11x17 trays
on a HPLJ4MV printer, and the lpr_clbpmf.awk script selects the manual feed
tray (for transparencies) on the Canon CLBP printer (CLBP uses the paper tray by default).
You also need a file /var/spool/lpr/lpr.log and /var/spool/lpr.roster.
The lpr.log file logs print requests.
The lpr.roster file lists the names of the printers available on your system.
The /etc/printcap file lists all printers available to your system, along
with the information needed by the spooler to send the job. Contact the
MolViz
Facility for details.
To use the lpr
wrapper, a entry in /etc/printcap MUST exist for printername_ps
AND printername_text, even if you are
printing to a print server.
Back to | Application Guide |
MolViz Home |
Send comments to chemvis@indiana.edu
Last updated: 01/23/2001