[comp.unix.sysv386] Remote Printing

bill@ssbn.WLK.COM (Bill Kennedy) (12/17/90)

A couple of weeks ago I posted a recipe for making uucp work across
the ethernet (ISC TCP/IP 1.2, 386/ix 2.2) using TLI.  The purpose of
the ceremony was to let one machine (ssbn) use another's printers
(dunsel).  First, the solution was less than optimal, but it did/does
work.  Further, the lp script enclosed with the original article darned
near worked, it worked well enough to suit me and to post.

Yesterday I decided to add another layer of distraction and move the
printers off of dunsel onto wrangler.  That's interesting because wrangler
isn't on the ethernet, so what on earth to do if I want to print something
from ssbn who has no direct connect to wrangler and wrangler is the only
machine in the building with a printer.

Here's the answer.  You need a script like what's enclosed on the originating
site and a similar one on the relay site, just the plain old lp script on the
print site.  This has all been tested with the ssbn->dunsel->wrangler lash up
and it should work for you.  Season to taste, there are some blood spatters
on it...  Also note that dunsel is running an identical script with rem changed
to wrangler since wrangler owns the printers.  Refinements are welcome, I don't
claim that it does anything but work.

#
#   Print a file using uux to a remote site's printer.
#   Note that if there are no optional arguments, just
#   uux the file to the remote site.  If there is only
#   one optional argument, pass it intact, but if there
#   is more than one optional argument, enclose it in
#   apostrophes and give it to eval to pass to the remote
#   site (courtesy wgb@balkan.TNT.COM, Bill Bunton)
#
#   /usr/spool/lp/admins/lp/interfaces/hp
#
send=/usr/bin/uux
############################### change below #################################
rem=dunsel
prt=hp
############################### change above #################################
user=$2
copies=$4
if [ "$5" = " " ]
then
	options=""
else
	options=$5
fi
shift; shift; shift; shift; shift
files="$*"
for file in $files
do
    if [ -z "$options" ]
    then
    	$send -p -a$user "$rem!lp -d$prt -n$copies" < $file
    else
          set -- $options
          if [ $# -eq 1 ]
          then
              $send -p -a$user "$rem!lp -o$* -d$prt -n$copies" < $file
          else
              eval $send -p -a$user "$rem!lp \'-o$*\' -d$prt -n$copies" < $file
          fi
    fi
done
exit 0
-- 
Bill Kennedy  usenet      {att,cs.utexas.edu,pyramid!daver}!ssbn.wlk.com!bill
              internet    bill@ssbn.WLK.COM   or attmail!ssbn!bill

stlouis@unixg.ubc.ca (Phill St. Louis) (03/21/91)

Is there a way to print from an InterActive Unix 2.2 System to printers 
attached to a Sun?  One of our Sun's is a print server to a line printer
and 4 laser printers.  It is very easy to do this with the other Suns
and with PC/NFS, but how do InterActive Unix Systems share printers?

Thank you.
P. St. Louis

tkevans@fallst.UUCP (Tim Evans) (03/22/91)

In <1991Mar20.221616.20133@unixg.ubc.ca> stlouis@unixg.ubc.ca (Phill St. Louis) writes:

>Is there a way to print from an InterActive Unix 2.2 System to printers 
>attached to a Sun?  One of our Sun's is a print server to a line printer
>and 4 laser printers.  It is very easy to do this with the other Suns
>and with PC/NFS, but how do InterActive Unix Systems share printers?

Assuming you have user equivalence set up properly:

	cat file | rsh Sunhost lpr
-- 
UUCP:		{rutgers|ames|uunet}!mimsy!woodb!fallst!tkevans
INTERNET:	tkevans%fallst@wb3ffv.ampr.org
Tim Evans	2201 Brookhaven Ct, Fallston, MD 21047

darcy@druid.uucp (D'Arcy J.M. Cain) (03/24/91)

In <1991Mar20.221616.20133@unixg.ubc.ca> Phill St. Louis writes:
>Is there a way to print from an InterActive Unix 2.2 System to printers 
>attached to a Sun?  One of our Sun's is a print server to a line printer
>and 4 laser printers.  It is very easy to do this with the other Suns
>and with PC/NFS, but how do InterActive Unix Systems share printers?

While perhaps not directly related to your question, I have an lp model
file that will print on remote machines using uux.  The idea is that you
use a command such as:
    pr filename | lp -d farpoint
where farpoint is a remote printer.  The file is compressed before sending
to reduce modem usage if it isn't already compressed.  The only change
required on the remote system is to add lp(1) and uncompress(1) permissions
in uucp for your site.

I'll post to alt.sources tomorrow.  I just have to check with the guy I
stole the original stuff from but I know he won't mind me posting it.

-- 
D'Arcy J.M. Cain (darcy@druid)     |
D'Arcy Cain Consulting             |   There's no government
Toronto, Ontario, Canada           |   like no government!
+1 416 424 2871                    |