SUMMARY: Printing to VAX printers from Unix lpr

From: John D Schneider (
Date: Wed Oct 02 1991 - 13:37:56 CDT

Although it's been said, many times, many ways, this list is great!
I received over 20 replies to my question about how to get lpr to hand me
the name of the destination printer so I could call our own VAX printer
interface. Several people suggested I purchase hardware/software solutions.
Although some of you might consider that a good option, on our research
department's budget I don't think it would ever fly. Good input though, thanx.

The vast majority of responses involved a simple trick anyone who wasn't a
UNIX novice like me would have thought of. It came in two flavors.

1) Set up a separate directory under /usr/spool for each printer (I was
already planning to do that.) Then use an input filter script and use the
pwd or cwd command within the script to trap the path name. Cut away
all but the printer name, and hand that as a parameter to my npserv program.
Ta Da!

2) Set up symbolic links for each of the printers pointing to my filter
script, as in:
lrwxrwxrwx 1 root 14 Jun 3 22:53 im_ps_a3 -> im_wrapper.csh*
lrwxrwxrwx 1 root 14 Jun 3 22:53 im_dup_ps_s -> im_wrapper.csh*
lrwxrwxrwx 1 root 14 Jun 3 22:53 im_ps_s -> im_wrapper.csh*
lrwxrwxrwx 1 root 14 Jun 3 22:53 im_dup_ps -> im_wrapper.csh*
lrwxrwxrwx 1 root 14 Jun 3 22:53 im_ps -> im_wrapper.csh*
-rwxr-xr-x 1 root 1550 Feb 28 1991 im_wrapper.csh*

   Then I look at argv[0] (or $0) to get the name the filter program is being
called as. This parameter will be the name of the printer, which I hand off
to my npserv program.

Both would work fine, and 1) is somewhat simpler since I don't have to remember
to put in the symbolic link. It also might be somewhat more robust, since
one helpful soul mentioned that separating out each printer into it's own
directory would help prevent lpd from getting confused during times of high

Thanks to all who replied (my apologies if I accidentally leave anyone off
this list):

John D. Schneider

* John D. Schneider Internet: *
* Research Computing Consortium Telephone: (314)537-6808 *
* Monsanto Company - Mail Zone GG3I *
* 700 Chesterfield Village Pkwy. *
* St. Louis, Missouri 63198 *

This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:06:18 CDT