*BSD News Article 81458


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!news.Hawaii.Edu!news.uoregon.edu!news.ironhorse.com!op.net!news.mathworks.com!uunet!in3.uu.net!news.zipnet.net!rtfm.ziplink.net!mi
From: mi@rtfm.ziplink.net (Mikhail Teterin)
Newsgroups: comp.protocols.smb,comp.sys.hp.hpux,comp.os.linux.setup,comp.unix.bsd.freebsd.misc,comp.unix.admin
Subject: Re: smbprint & /etc/printcap
Date: 23 Oct 1996 17:41:54 GMT
Organization: Aldan at Newton Upper Falls
Lines: 45
Message-ID: <54lld2$b6r@news.zipnet.net>
References: <4ic3v9$odd@risky.ecs.umass.edu>
Reply-To: mi@ALDAN.zipnet.net
NNTP-Posting-Host: 199.232.255.52
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Newsreader: knews 0.9.8
To: langlois@alex.ecs.umass.edu
Xref: euryale.cc.adfa.oz.au comp.protocols.smb:8638 comp.sys.hp.hpux:48410 comp.os.linux.setup:79412 comp.unix.bsd.freebsd.misc:29865 comp.unix.admin:49089

[posted and mailed. some groups added]

Honorable Philip M. Langlois
      wrote on 15 Mar (in article <4ic3v9$odd@risky.ecs.umass.edu>):
=I'd like to use an HP1600 printer connected to a PC running
=Win95, but using my Linux box over a LAN. The printcap
=entry has an if= line, which points to the smbprint script.
=How can I use apsfilter or something similar *and* smbprint?
=Incidentally, I'd like to dothis from HP-UX, too, but I'm
=not as familiar with its printer config files.

As honorable John Lucas (jlucas@uvi.edu) already mentioned:
	The apsfilter is a wonderful program, but unfortunately it
	can only be used on a locally attached printer (according
	to the documentation anyway).

For any M$ systems this would have been the end of it. On Unix,
this means, you just need some scripting. Make a script of your own,
which will pipe it's stdin into the apsfilter, and apsfilter's
stdout into some file. Then -- just send this file to the
printer using your favourite smb-script:

#!/bin/sh
#Process the file according to your printer's needs
your-aps-filter-alias > /tmp/to_be_printed.$$
# Print the result. I do not have smbprint installed for whatever reason ;(
echo print /tmp/to_be_printed.$$ | \
	/usr/local/samba/smbclient \\\\printserver\\printer -P -N -U $4@$6
# Remove the temporary file:
rm -f /tmp/to_be_printed.$$

This may be an example... If called by `lpd' $4 will be a username,
$6 will be hostname. -N will make sure smbclient does not ask for
password. Also, make sure, lf=/dev/null is in your /etc/printcap
for this printer.

BTW, the latest ghostscript (4.003) supports even more printers!

HPUX may have a printing scheme of it's own, but I am sure they support
lpd as well (IRIX does).

	-mi

-- 
	"Windows for dummies"