[Samba] *sighs* I can print directly but not with lpd

Joel Hammer Joel at HammersHome.com
Tue Feb 5 06:25:09 GMT 2002


I do this same thing between two linux boxes, so it should work the same.
The only difference is I send the output to a file, not to a printer, and, I
check to see if the file is postscript. If it is, I convert it to text. To
translate it, by which I think you mean to add an 0A to the end of each
line, change the filter where indicated to read:
cat | sed "s/.*/&\r/" 

Client:
/etc/printcap

text:\
        :sd=/var/spool/lpd/text:\
        :rm=hammer2.jhammer.org:\
        :rp=text:\
        :sh:mx#0:          


Server:
/etc/printcap


text:\
        :sd=/var/spool/lpd/text:\
        mx#0:\
        :lp=/tmp/textprint:\
        :if=/var/spool/lpd/text/filter:\
	:sh:

filter:

#!/bin/bash
cat < /dev/null > `set | sed -n "s/.*:lp=//p"`
set > shellvalues
a=`set | sed -n "s/^l//p" | xargs file | grep PostScript`
echo $a > junkname
[ -z "$a" ] || {
cat | ps2ascii
exit 0
}
a=`set | sed -n "s/^l//p" | xargs file | grep text `
[ -z "$a" ] || {
cat   <---Change this line as indicated above to add the 0a.
exit 0
}
echo invalid file type of
set | sed -n "s/^l//p" | xargs file
exit 0                                             


Joel


> -----BEGIN PGP SIGNED MESSAGE-----
> 
> 
> ok thanks.
> 
> I'm trying to make lpr deliver the text file to the
> win98se's local printer, via smbclient. I can manually
> run smbclient and interactively tell it translate, then
> print filename and have it print on the printer. when
> I try to make that happen with lpr/lpd and the smbprint
> filter it appears to try to execute the lines of the file
> as commands, so it never finishes properly. I have
> /etc/lmhosts and /etc/hosts mapping POOH and EEYORE
> to thier IPs, and DSN maps them also. I can put them
> in //EEYORE/c/windows/LMHOSTS.SAM if that would help.
> 
> 	IP		DNS			NetBIOS OS
> client:	66.57.250.124	pooh.asarian.org	POOH 	FreeBSD4.4 Samba2.2.2
> server: 66.57.14.168	eeyore.asarian.org 	EEYORE	Windows/98SE
> 
> printer server/support	lpd / lpr / lpq / lprm / lpc
> printer	device		Apollo P2200 (HP brain)	//eeyore/apollo
> 
> the file is a text/plain us-ascii text file
> 
> Fuzzy
> 
> On Mon, 4 Feb 2002, Joel Hammer wrote:
> 
> > If you can be more specific, you might get some specific advice.
> > I don't think most folks are going to read through all the stuff you have
> > attached below. (I think it is several hundred lines long.)Tell us:
> > 1. What machine are you trying to print from and how you want to print.
> > (lpr, or a big smbclient command or something else?)
> > 2. What you have for a print server.
> > 3. What type of printer you are using.
> > 4. What kind of file you are trying to print.
> >
> > If you want a black box solution, I can't help, (black box printing
> > solutions usually defeat me, and you can't debug them.)
> >
> > Joel
> >
> >
> 
> - -- 
>                 		     _____ __ __ ____  ____ __  __
> 		                    / ___// // //__  )/__  )\ \/ /
>                   		   / __/ / // /   / /__ / /__\  /
>         		          (_/   (____/   <____/<____//_/
> 
>                                         President, ASARian Inc.
>                                         Sys Admin, ASARian.org
> 
>                                         Admin Contact for the
>                                         ASARian.org domain.
> 					fuzzy at asarian.org
> 
> - --
> 
> PGP 2.6.3 Key fingerprint = 56 64 1D D9 65 53 B2 20  79 97 EF 45 18 FE 19 4E
> 
> finger fuzzy at pooh.ASARian.org for public key.
> 
> ASARian Inc. provides free internet access to survivors of sexual abuse.
> We are a not-for-profit organization (501(c)3). ASARian.org takes its name
> from the usenet newsgroup alt.sexual.abuse.recovery, (since replaced by
> alt.sexual.abuse.recovery.moderated due to spam).
> 
> 
> -----BEGIN PGP SIGNATURE-----
> Version: 2.6.3ia
> Charset: noconv
> Comment: Made with pgp4pine 1.76
> 
> iQCVAwUBPF9m3ICilGw9Fc89AQFrPgP/QEXl6GcLjQUKHMwKAs/8Swub01WdnYRr
> 3Uf2ltXqlW5TF5rO+6cAvmRBAICJT8cbHAno3gDqWfdwjBBcjVemRbSE17cf5FOY
> 8jJeDOc8n4xEFI1sM0siGuQhnWWJIM9sq2NJGc+dRE3eCOXA8BSYjR/LNZk9iXwZ
> 9HLzJSF7npQ=
> =nBDB
> -----END PGP SIGNATURE-----
> 




More information about the samba mailing list