Re: [exim] Express list in reduce?

Páxina inicial
Borrar esta mensaxe
Responder a esta mensaxe
Autor: Jeremy Harris
Data:  
Para: exim-users
Asunto: Re: [exim] Express list in reduce?
On 02/04/2021 17:08, Felipe Gasper via Exim-users wrote:
> domainlist mydomains = foo.com : bar.com
>
> … is there any way to pass that domain list to, e.g, ${reduce}?
>
>     For testing purposes I’d like to do something like:

>
> -----
> ${reduce {+mydomains}{}{${if eq{$value}{}{}{$value,}}$item}}
> -----
>
> … and have it give me “mydomains”, joined with a comma.


${listnamed_d:mydomains} as source for your reduce.

Bear in mind that you a vulnerable to list elements
that already have an embedded comma, and ones with
an embedded colon may surprise you.


It'd be nicer if listnamed had a way of getting a
custom output separator, and/or if reduce did full
list expansion, of course.
--
Cheers,
Jeremy