[4652] in RedHat Linux List

home help back first fref pref prev next nref lref last post

Re: printing in win95 box

daemon@ATHENA.MIT.EDU (Almond Wong)
Fri Nov 15 21:20:04 1996

Date: Sat, 16 Nov 1996 10:16:24 +0800 (HKT)
To: redhat-list@redhat.com
From: almond@asiaonline.net (Almond Wong)
Resent-From: redhat-list@redhat.com
Reply-To: redhat-list@redhat.com

The following is from samba digest. Hope this help.


******************* samba digest **********************

Date: Wed, 11 Sep 1996 15:18:32 -0700 (PDT)
From: Eric Shih <erics@anvil.omil.wa.com>
To: Zhiyun Xie +1 201 386 6480 <zxie@fuwutai.wh.lucent.com>
Cc: samba@arvidsjaur.anu.edu.au
Subject: Re: printing from Unix to WFWG
Message-ID: <Pine.SOL.3.91.960911145558.1752A-100000@anvil>


Sure:

1. Make sure you are running NetBios over TCP/IP on the PC, and also make
sure the PC has a host name (this little bug-a-boo caught me several times!)

2. Share the printer on the PC. Use smbclient on the Unix box to make
sure you can see the printer share.

3. Write the interface script on the UNIX host:

-------START
#!/bin/sh
# print from UNIX onto a printer on the SMB network.

client="pc_name"
pshare="shared_printer"
printfile=$6

if [ -s $printfile ]; then
(echo "translate" ; echo "print $printfile" ; echo "quit") \
| /usr/local/samba/bin/smbclient \\\\$client\\$pshare -P -N
fi
exit 0
-------END
As you can see, it's a simple script with no error checking. Works great
on a LAN, dicey over a bad WAN connection.

4. Create the printer on the host. On Solaris, it is:

lpadmin -p <printer> -I simple -i <interface script> -v /dev/null

(you can also include Postscript with the -I option if your printer is
postscript enabled.)

enable <printer>

accept <printer>

5. Test the new printer. If successful, brag about being an lp - hacker.

I'm working on hacking up a script with error checking, because we've got
an unreliable WAN connection that we print over. This script works great
when the WAN is up, but doesn't provide much safety if the WAN dies.
(I think that root actually gets a mail message about a broken pipe, but
that's about it...)

Hope this helps!




--
  PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
  ________________________________________________________________________
  http://www.redhat.com/RedHat-FAQ   http://www.redhat.com/RedHat-Errata
  http://www.redhat.com/RedHat-Tips  http://www.redhat.com/mailing-lists
  ------------------------------------------------------------------------
To unsubscribe: mail -s unsubscribe redhat-list-request@redhat.com < /dev/null


home help back first fref pref prev next nref lref last post