You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Document <dd...@gmail.com> on 2009/03/20 01:41:24 UTC

How to use variable within a variable in ant?

Hi,
I want to use a variable within variable scenario. For eg.

<property name="var1" value="somevar" />
<property name="somevar" value="anothervalue" />

Now I want to use something like ${${var1}}  to retrieve ${somevar}. How do
I do it? On unix shell, eval works fine but when I try ant exec task to run
eval, it doesnt recognize the command.

Thanks

AW: How to use variable within a variable in ant?

Posted by Ja...@rzf.fin-nrw.de.
http://ant.apache.org/faq.html#propertyvalue-as-name-for-property

Jan 

>-----Ursprüngliche Nachricht-----
>Von: Document [mailto:ddocument@gmail.com] 
>Gesendet: Freitag, 20. März 2009 01:41
>An: user@ant.apache.org
>Betreff: How to use variable within a variable in ant?
>
>Hi,
>I want to use a variable within variable scenario. For eg.
>
><property name="var1" value="somevar" />
><property name="somevar" value="anothervalue" />
>
>Now I want to use something like ${${var1}}  to retrieve 
>${somevar}. How do
>I do it? On unix shell, eval works fine but when I try ant 
>exec task to run
>eval, it doesnt recognize the command.
>
>Thanks
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org