Re: [exim] How to Remove new line or space (or how to escape…

Top Page
Delete this message
Reply to this message
Author: Mike Cardwell
Date:  
To: exim-users
Subject: Re: [exim] How to Remove new line or space (or how to escape dkim selector)
* on the Thu, Oct 17, 2013 at 05:37:33PM +0200, Marcin Miros??aw wrote:

> Thanks! I saw word "Perl" in description of ${sg} and I wrongly assumed
> it launch perl engine.
> I'd like to ask for help in one more thing. I've got problem with nested
> braces:
> $ exim -be '${sg{
> {${readfile{/etc/exim/dkim/test2.test.com.pl.selector}} } {\n|\ }{} }}'
> {131017}
>
> But I'm expecting to get only digits.
> When I remove braces arround ${readfile I'm getting:
> $ exim -be '${sg{
> ${readfile{/etc/exim/dkim/test2.cadera.com.pl.selector}} {\n|\ }{} }}'
> Failed: missing or misplaced { or }


I first wrote out the ${sg} part:

${sg{}{}{}}

I then added some newlines for readability:

${sg{
}{
}{
}}

I then added the arguments which we want to pass to ${sg}:

${sg{
    ${readfile{/etc/exim/dkim/test2.cadera.com.pl.selector}}
}{
    \n|\ 
}{


}}

I then compressed it down to a single line:

${sg{${readfile{/etc/exim/dkim/test2.cadera.com.pl.selector}}}{\n|\ }{}}

It's almost the same as your second version apart from a semi-colon
being out of place.

Regards,

-- 
Mike Cardwell  https://grepular.com/     http://cardwellit.com/
OpenPGP Key    35BC AF1D 3AA2 1F84 3DC3  B0CF 70A5 F512 0018 461F
XMPP OTR Key   8924 B06A 7917 AAF3 DBB1  BF1B 295C 3C78 3EF1 46B4