[comp.sys.sun] SunOS to printer on ethernet terminal sever?

gplan@husc6.harvard.edu (George A. Planansky) (04/04/89)

We have several printers connected to serial ports on 3COM (Bridge) CS210
communications servers, so that you can connect to a printer by connecting
to its tcp/ip address on ethernet.  For these printers, which are NOT
connected in the usual Unix way to a serial or parallel port on a
computer, how do I spool from Unix to a printer?

Partial answer:  make the following script, called printer.filter:
   #
   cat | (telnet printeraddress) >>& printer.log
where "printeraddress" is the tcp/ip address of the printer's port
on the terminal server.

Then use the following printcap entry:
netpr|printer at printeraddress on terminal server/
	|lp=/dev/null|of=/usr/local/bin/printer.filter

Problem:  It works fine except that if the telnet connection fails, say if
its busy, lpr still bithly spools jobs off to /dev/null.

1. how can I get the printer.filter script to tell lpr the status of the
telnet connection?  I've tried grep'ing for "busy" in the script, and
exiting with an error status, but the error status does not reliably get
propagated back to the lpr program.  What can I do about that?

2. if there is a better way to connect to a printer via ethernet and a
terminal server, I'd be obliged to learn of it.

I can get email as:  gplan@ra.umb.edu .
Otherwise I am George Planansky, at Atmosphere Environment Research, 
840 Memorial Drive, Cambridge MA 02174, USA; phone (617) 547-6207.