OK, UNIX GURU

OK, UNIX GURU

Post by Wayne H. Colem » Thu, 30 Nov 1995 04:00:00



PROBLEM:
I run a program at work that produces a print out on any printer attached  
to the LAN. Now,  How do I print local (at home) when dialing in via a  
modem. Is this possible? I dial in as a vt100 term.

Thanks
any help will help

:=)  Wayne

 
 
 

OK, UNIX GURU

Post by Scott G. Ha » Fri, 01 Dec 1995 04:00:00



Quote:>PROBLEM:
>I run a program at work that produces a print out on any printer attached  
>to the LAN. Now,  How do I print local (at home) when dialing in via a  
>modem. Is this possible? I dial in as a vt100 term.

You can do what a number of folks do, and that is to write a little C
program that sends to your terminal the escape code to send output via
the printer port, then just passes the bytes of the file(s), and then
send the escape code to switch the terminal back to the screen.

I remember developing and using an "lpr" program a while back that did
just that, but I don't have it handy now.

Different UNIX systems have different terminfo/termcap formats,
specifically the capability of "switch output to printer port" -- some
have it, some don't.  You may need to hardcode an array of escape codes
based on terminal type, rather than using termlib functions.

If you are the administrator of the UNIX system you dial into, another
method is to setup a printer queue called "local", where you specify
your own shell script for the interface program.  This shell script
can then do a lookup of the user submitting the job against "who", and
get the connecting port.  Then it can echo a hardcoded escape code to
switch the terminal to the printer port, cat the file, then send the
escape code to switch back.

A more general approach could be to have the script do the "-o" option
processing like other lp interface scripts, and require the user to
include a "-o term=XXXX" to allow the script to lookup the proper escape
code from an array of codes per terminal type.

--
- sgh     What are you doing, reading the words at the bottom?!?   Key Grip!?!
          What is a key grip anyway?!  I don't give credit to anybody -- it's

AT&T Bell Laboratories - GCBS, Columbus, OH, USA