[comp.sys.hp] Printing from HP to Sun laser printer

rick@landau.uchicago.edu (Rick Ernst) (02/03/90)

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 Ernst                             Department of Physics
rick@control.uchicago.edu          The University of Chicago

bobh@unicorn.WWU.EDU (Bob Hayes) (02/03/90)

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 <remote_host_name>:/tmp/$1
remsh <remote_host_name> lpr /tmp/$1
remsh <remote_host_name> rm /tmp/$1
remsh <remote_host_name> 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 <remote_host_name> 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! 

quent@cs.iastate.edu (Quent Johnson) (02/09/90)

I've used the following to print from our HP 9000/350 and HP 9000/370
to a Sun 3/50:
		on MACHINE /usr/ucb/lpr FILENAME

Or -- put "alias rprint on MACHINE /usr/ucb/lpr" in your .login

By the way -- with HP-UX lpr is found in /usr/bin which usually comes
before /usr/ucb in your search path (unless you exclusively use HP-UX
and /usr/ucb isn't in your path at all!)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Quentin Johnson {} ISU Computer Science Department
quent@atanasoff.cs.iastate.edu | uunet!umix!sharkey!atanasoff!quent
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~