> From [EMAIL PROTECTED] Wed Jul 23 20:18:25 2003
> Date: Thu, 24 Jul 2003 12:26:43 +1000
> From: Paul Armstrong <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: Re: LPRng: Issues between lp and lprng
>
> On Mon, Jul 07, 2003 at 10:19:19AM +0200, Henrik Edlund wrote:
> >
> > 4.19.2. Converting SystemV Options to LPRng Options
> >
> > On some SystemV lp print spoolers, the lp -o option, puts the option
> > information into the control file S line, and on other systems on the puts
> > the option information into the control file O line. To convert these
> > options to LPRng Z options use the :prefix_option_to_option=from,from...
> > to facility to prefix the from control file lines to the to control file
> > line. For example:
> >
> > # System V to LPRng - S and O to Z options
> > convert:server:tc=.common
> > :[EMAIL PROTECTED]:prefix_option_to_option=S,O Z
> > # LPRng to System V O options
> > convert:server:tc=.common
> > :[EMAIL PROTECTED]:prefix_option_to_option=Z O
>
> Thanks, I'd missed that.
> However, the following config doens't work either:
>
> tidovrl07c:rp=raw:sd=/var/spool/lpd/tidovrl07c:sh:if=/usr/local/libexec/filters/
> ifhp:if=/usr/local/libexec/filters/lpf:rm=10.49.1.90:lpr_bounce:prefix_option_to
> _option=S,O Z
>
> Thanks,
> Paul
Lets look at your printcap in detail:
tidovrl07c
:rp=raw
:sd=/var/spool/lpd/tidovrl07c
:sh
:if=/usr/local/libexec/filters/ifhp
:if=/usr/local/libexec/filters/lpf
:rm=10.49.1.90
:lpr_bounce
:prefix_option_to_option=S,O Z
Note: you have two :if entries. Perhaps you want to use ':filter' instead?
Or only one :if entry?
Short and brutal answer:
tidovrl07c
:[EMAIL PROTECTED]
:sd=/var/spool/lpd/%P
:rm=10.49.1.90
:prefix_option_to_option=S,O Z
tidovr_out:
:[EMAIL PROTECTED]
:sd=/var/spool/lpd/%P
:filter=/usr/local/libexec/filters/ifhp
More detailed answer:
The control file options are rewritten only when transferring from one
queue to another. But don't despair - you can pass the options to the
filter:
:if=/usr/local/libexec/filters/lpf -Z ,$-O
$X with -X<value> (if present)
$0X with -X <value> (adds space)
$'X with -X'<value>' (adds quotes)
$-X with <value> (drops key)
$0-X with <value> (same as $-X)
$'-X with '<value>' (adds quotes)
${ss} with value of printcap option ss
$'{ss} with quoted value of printcap option ss or job control file option
So, ',$-S,$-O' gets evaluated as ',<S options>,<O options>'
and the ifhp filter will split at the quotes and then at the commas.
<aside> so I typed this in to check it, and I got some garbage
for the $-S option - to be exact, the printer name...
</aside>
BUT... 'S' is reserved for the Printer Comment Name (GRRRNNN....,
history strikes again.) In the next release you can do:
${X} with value of job control file option X
and now:
',${S},${O}'
Will work correctly.
Sigh...
Patrick ("6 messages down, 12,233 left to go") Powell
Version LPRng-3.8.22 - Sun Jul 20 16:02:05 PDT 2003
lpf.c - removed log() and fatal().
(Suggested by: Torsten Rohlfing <[EMAIL PROTECTED]>)
Filter command line options now allows ${X} to reference a control file
option. You can now use:
$X with -X<value> (if present)
$0X with -X <value> (adds space)
$'X with -X'<value>' (adds quotes)
$-X with <value> (drops key)
$0-X with <value> (same as $-X)
$'-X with '<value>' (adds quotes)
${ss} with value of printcap option ss
$'{ss} with quoted value of printcap option ss or job control file option
Example: filter=ifhp -Z '${S},${O}'
This will get the O and S options from the job control file. Note that
$S is the 'printer comment name' and '$P' is the 'actual printer name'.
(prompted by a question from: Paul Armstrong <[EMAIL PROTECTED]>)
Patrick Powell Astart Technologies
[EMAIL PROTECTED] 6741 Convoy Court
Network and System San Diego, CA 92111
Consulting 858-874-6543 FAX 858-751-2435
LPRng - Print Spooler (http://www.lprng.com)
-----------------------------------------------------------------------------
YOU MUST BE A LIST MEMBER IN ORDER TO POST TO THE LPRNG MAILING LIST
The address you post from MUST be your subscription address
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.
-----------------------------------------------------------------------------