Jeremy Harris wrote:
> Hi,
>
> I was trying to use a expansion to specify the entire content
> of a transport-filter specification, but it seems that the trick
> of putting double-quotes round the expansion-item (which contains
> spaces) to prevent it being split by the parsing into an argv
> only operates after the first arg.
>
> That is,
>
> transport_filter = /some/path "${if = {${lookup pgsql{select blah}
> {$value}fail}} {1}\
> {/path/to/command arg1 arg2} {}}"
>
> does the lookup, but
>
> transport_filter = "${if = {${lookup pgsql{select blah}
> {$value}fail}} {1}\
> {/path/to/command arg1 arg2} {}}"
>
> does not.
>
>
> Has anyone else seen this? What's a good way to transport-filter
> depending on
> a lookup, but avoid the overhead when it's not needed?
[Philip Hazel]
>That's because the quotes are taken as part of the setting of the string value of the option. If you want quotes at the start and end of the value of an
>option, you need
>
> transport_filter = "\"....\""
Fine, but doesn't help me: it quotes the entire command-line I
retrieved with the lookup - so it's all argv[0].
It seems to me that the split into argv is being done too early,
before expanding the string. Shouldn't it be done last?
Cheers,
Jeremy