Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!samsung!think!mintaka!ogicse!unicorn!bobh From: bobh@unicorn.WWU.EDU (Bob Hayes) Newsgroups: comp.sys.hp Subject: Re: Printing from HP to Sun laser printer Message-ID: <474@unicorn.WWU.EDU> Date: 2 Feb 90 20:57:43 GMT References: <7417@tank.uchicago.edu> Reply-To: bobh@unicorn.WWU.EDU (Bob Hayes) Distribution: usa Organization: Western Washington Univ, Bellingham, WA Lines: 62 In article <7417@tank.uchicago.edu> rick@control.uchicago.edu (Rick Ernst) writes: >Is it possible to print from an HP-UX machine sitting on Ethernet to a >laser printer attached to a Sun-3 on the same net? Evidentally the Suns all >have a file telling the printer daemon where to send printer files, but I >can't find anything similar for the HP's. > >On the Suns, one uses the command "enscript", which allows one to print >to a Postscript printer, but I don't know whether that command >sends ASCII or Postscript to the computer to which the printer is attached. >Obviously the HP would have to do much the same thing in order to use the >same printer. > >If any of this sounds familiar and you know how to do it, or where to find >relevent information, please post or e-mail. >rick@control.uchicago.edu The University of Chicago I can't speak for the right way to use the HP machines, not having one, but here is some ether-trickery that allows you to use a remotely attached printer that has NOT been set up as such....PROVIDED that you have a login on the machine with the printer. This is a sysV example of a shell script 'remote_print'; invoked as 'remote_print foo.file' ------------- # shell remote print helper # uses /bin/sh (hey, remember we're sysV here!) rcp $1 :/tmp/$1 remsh lpr /tmp/$1 remsh rm /tmp/$1 remsh lpq ------------- What it does.. Remote copy (rcp) the $1 argument ( expanded to foo.file) to the printhost storing it in the /tmp directory. Invokes a remote shell on the printhost to print the file stored in /tmp. Once the printer call (lpr) has returned, the file has been linked to the print Q and the /tmp filename can be removed with another remote shell call. The data for the file is still there, linked to the print Q. The last remote call (lpq) just shows the print Q so you know you're on it. This assumes that the remote_host is a sun (lpr, lpq stuff) and that the sender has remsh as the remote shell (on the sun it's just rsh). It also assumes that you can do a remote login, that your .rhost files are good, etc. A more trivial line which works with bsd netted systems is just to do something like: %cat foo.file |rsh lpr This just pipes the catted file to the standard input of the lpr Q. If your foo.file is the Postscript file, this will work, but if you want to run it thru enscript, replace 'lpr' with 'enscript'. Postscript is ascii, in that it has no hi_bits set, but plain ascii cannot be dumped into a postscript printer and get very interesting output. -- Bob Hayes < bob@arthur.wwu.edu > USnail follows: Western Washington University Computer Science Dept. Bond Hall 302, Bellingham, Washington 98225 Obbligato Disclaimer: Real programmers carry screwdrivers!