Re: [exim] Doc Query : listextract

Etusivu
Poista viesti
Vastaa
Lähettäjä: Always Learning
Päiväys:  
Vastaanottaja: Exim
Aihe: Re: [exim] Doc Query : listextract

On Thu, 2015-09-17 at 09:10 +0100, Jeremy Harris wrote:
> On 17/09/15 04:07, Always Learning wrote:
> > exim.org/exim-html-current/doc/html/spec_html/ch-string_expansions.html
> >
> >
> >> ${listextract{-3}{<, x,42,99,& Mailer,,/bin/bash}{result: $value}}
> >>
> >> yields “result: 99”.
> >
> > If the right-most data in a punctuated field is labelled -1, then
> > shouldn't the -3 yield '& Mailer' ?
>
> I get 42, not 99. You found a docs bug.
>
> But your "-1"th field runs from the "&" onwards,
> because of the rules on doubled list separators.
>
> You'll be better off with extract, for this job.


Thanks.

Queries:

(1) Are there 2 strings ?
x,42,99,
Mailer,,/bin/bash

(2) If so, then the resulting combined string will be: x,42,99,Mailer,,/bin/bash
with 6 items including item 5 a null entry.

(3) If -1 means the right-most item, then that item will be
'/bin/bash', so how does -3 produce anything except 'Mailer' ?

(4) Or does '<,' apply only to the first of the 2 strings even thought
it and the two strings are enclosed in the same pair of round brackets
? Does a '&' negate the effect of the '<,' ?

Puzzled.



--
Regards,

Paul.
England, EU.      England's place is in the European Union.