procmail
[Top] [All Lists]

Re: Can variables be nested?

2004-05-24 17:55:57
On Mon, May 24, 2004 at 10:40:53AM -0700, Gary Funck wrote:
I think you can add extra $'s to the line where you want variables
to be successively expanded. 
For example...
:0
* $$ B ?? "$V1"

And indeed that works!  Thanks, Gary.

I experimented a bit to see if I could nest yet another level,
and that seems to work too, with the addition of another $.  But you
have to be careful with the layout of all those $s:

:0
* $ $ $ ${doubly_nested_var}

and

:0
* $$ $ ${doubly_nested_var}

both work (as does * $ $ $ $ ... ${doubly_nested_var})

But

:0
* $$$ ${doubly_nested_var}

and

:0
* $ $$ ${doubly_nested_var}

both fail, (as does * $ $ ${doubly_nested_var}).

You need to add enough $s to cover the max nesting level of your
variables, but extra $s don't seem to hurt, as long as there are
spaces between them.

FWIW,

Jim

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>