> From [EMAIL PROTECTED] Tue Jun 20 16:31:43 2000
> From: "Paul Moore" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Subject: RE: LPRng: Printcap entry "filter="
> Date: Tue, 20 Jun 2000 23:20:04 +0100
>
> From: [EMAIL PROTECTED]
> > # this is first, the is the default, and you get it used
> > # if somebody cannot spell correctly - bit dangerous that,
> > # but I think this is what you want
> >
> > pr1|*:tc=.common
> > :lp=ip.address.printer%9100
> > :ifhp=model=thismodel
> >
> > pr2:tc=.common
> > :lp=ip.address.printer%9100
> > :ifhp=model=thismodel
> >
> > .common:
> > :sd=/var/spool/lpd/%P
> > :whateveris=common.to_things
> > :filter=/..../ifhp
> > :ifhp=model=some_common_model
>
> That looks pretty good - it's almost exactly what I want. If I understand
> things, what I actually want is something like
>
> mopier|lj5:tc=.common
> :lp=ukdcp007.rundc.uk.origin-it.com%9100
> :ifhp=model=lj5simopier
>
> colour:tc=.common
> :lp=ukdcp026.rundc.uk.origin-it.com%9100
> :ifhp=model=colorlaserjet
>
> others|*:tc=.common
> :lp=%P.rundc.uk.origin-it.com%9100
>
> .common:
> :sd=/var/spool/lpd/%P
> :filter=/..../ifhp
> :ifhp=model=lj4
>
> ie, the mopier is on ukdcp007, and is the default printer. The colour
> laserjet is on ukdcp026. Any other printer is on an IP address the same as
> its printer name, has a spool directory /var/spool/lpd/%P, uses ifhp, and is
> assumed to be a lj4. Misspellings will be caught by the lack of a spool
> directory (will they?)
>
> Actually, I think I can simplify this further:
>
> ukdcp007|mopier:tc=.common
> :ifhp=model=lj5simopier
>
> ukdcp026|colour:tc=.common
> :ifhp=model=colorlaserjet
>
> others|*:tc=.common
>
> .common:
> :lp=%P.rundc.uk.origin-it.com%9100
> :sd=/var/spool/lpd/%P
> :filter=/..../ifhp
> :ifhp=model=lj4
>
> With this much simplification, I could probably remove the * entry, and
> specify all the network printers individually (there aren't that many of
> them...)
Yes, I think so as well.
>
> The only thing I'm not 100% clear on is how %P is resolved. The HOWTO seems
> to imply that the first entry is used, which makes resolving the IP address
> for the 'others' case like this fail to work. (It also merges all the
> implicitly defined printers in your example onto a spool directory
> 'others' - was that what you intended?) As I say, I may be happy to omit the
> '*' case, so that may not be a killer issue.
The %P is evaluated 'lazily', that is, after the name of the print queue
has been determined. So your '.common' entry will be expanded (evaluated_)
and the %P expanded to 'common'. But you can try:
*:tc=.common
This is really tricky - now you will have the printer name substituted
as you wanted.
lpr -Ppr1 ->
*:tc=.common -> %P = 'pr1'
:lp=%P.rundc.uk.origin-it.com%9100 -> lp=pr1.rundc.uk.oring-it.com%9100
:sd=/var/spool/lpd/%P -> sd=/var/spool/lpd/pr1
:filter=/..../ifhp
:ifhp=model=lj4
> Hmm. Looking further (section 8.5 of the HOWTO) implies that if I do
>
> *|others:tc=.common
>
> then %P will be whatever the user types. If an invalid name is used, the
> lack of a spool dir will catch it. Otherwise, %P is the printer name and so
> the IP address resolves as I want. To merge all the non-explicit printers'
> spool directories, will this work?
Yes, this is EXACTLY the way it works.
>
> *|others:tc=.common
> :sd=/var/spool/lpd/others
>
> ie, will the explicit specification override the one taken from the tc
> option?
>
> I'd appreciate any comments on this. Sorry for the basic stuff - I'm new to
> all this, and I'm just getting a feel for navigating the available
> documentation.
>
> Paul.
Patrick Powell Astart Technologies,
[EMAIL PROTECTED] 9475 Chesapeake Drive, Suite D,
Network and System San Diego, CA 92123
Consulting 858-874-6543 FAX 858-279-8424
LPRng - Print Spooler (http://www.astart.com)
-----------------------------------------------------------------------------
If you need help, send email to [EMAIL PROTECTED] (or lprng-requests
or lprng-digest-requests) with the word 'help' in the body. For the impatient,
to subscribe to a list with name LIST, send mail to [EMAIL PROTECTED]
with: | example:
subscribe LIST <mailaddr> | subscribe lprng-digest [EMAIL PROTECTED]
unsubscribe LIST <mailaddr> | unsubscribe lprng [EMAIL PROTECTED]
If you have major problems, send email to [EMAIL PROTECTED] with the word
LPRNGLIST in the SUBJECT line.
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
If you need help, send email to [EMAIL PROTECTED] (or lprng-requests
or lprng-digest-requests) with the word 'help' in the body. For the impatient,
to subscribe to a list with name LIST, send mail to [EMAIL PROTECTED]
with: | example:
subscribe LIST <mailaddr> | subscribe lprng-digest [EMAIL PROTECTED]
unsubscribe LIST <mailaddr> | unsubscribe lprng [EMAIL PROTECTED]
If you have major problems, send email to [EMAIL PROTECTED] with the word
LPRNGLIST in the SUBJECT line.
-----------------------------------------------------------------------------