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:

  1. 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.
  2. 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.
  3. Type "lpr help" to read more about lpr.

Notes about the amended lpr command

The lpr wrapper script solves the following problems:

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:

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