Autor: Toralf Lund Data: Dla: exim-users Temat: Re: [exim] How to set up command with arguments in ${run ...} ?
Philip Hazel wrote:
>On Wed, 16 Mar 2005, Toralf Lund wrote:
>
>
>
>>How exactly do I execute a command with arguments via ${run ...}? Based on the
>>Exim spec, I thought I might do something like
>>
>>${run{/bin/echo tst}{$value}}
>>
>>(and get the output of "/bin/echo tst", i.e. just "tst"), but if I try this,
>>the exim log says:
>>
>>failed to expand "${run{/bin/echo": missing } at end of string
>>
>>Exim version is 4.30.
>>
>>
>
>Where have you put that expansion? Note that it says it failed to
>expand "${run{/bin/echo" not "${run{/bin/echo tst}{$value}}". It has
>taken the white space as a terminator.
>
> Yeah, so I noticed. I didn't realise it mattered where I put it, as I
thought the {} would take precedence (if that's the right way of putting
it) over the separator character check "outside" the string logic.
In any case, this is just a test (as you can tell by the command), and I
have several things in mind, but I'm mainly taking about option values
in routers. One thing I wanted to try out was
route_list = * ${run{<command that will create router list>}{$value}}
or possibly even
route_list = * ${run{<command that will create router list>}{$value}}/MX
in a manualroute router. And to make it more interesting, maybe I want
to put the ${run ...} expansion inside a macro...
>Guess: You have this in a filter? Or maybe in a pipe command? You
>probably need some quotes.
>
> Ohno. Not another quote issue... One of the most difficult tasks I can
imagine is to get those right...
Anyhow, in the simple case, putting quotes around the expansion works
all right. I'm not sure about the macro variant...