On Wed, Aug 17, 2011 at 11:04 AM, Holman, Chris <chris.hol...@bskyb.com> wrote:
> This ant script snippet:
>      <property name="lineOfTestLine" value="$ $$ $$$ $$$$ $$$$$ $$$$$$">
>      <echo message="${lineOfTestLine}">
>
> Prints out:
>     [echo] $ $ $$ $$ $$$ $$$
>

Interestingly, I ran the following test:

<project>
    <property name="test1" value='$ $$ $$$ $$$$ $$$$$ $$$$$$'/>  <!--
Try single quotes -->
    <echo message="TEST #1 = ${test1}/>  <!-- Prints $ $ $$ $$ $$$ $$$-->

    <condition property="test2" value="test2 matches">
        <equals arg1="${test1}" value="$ $$ $$$ $$$$ $$$$$ $$$$$$$"/>
    </condition>
    <echo message="TEST #2: ${test2}"/> <!-- Prints "TEST #2: test2 matches-->

    <condition property="test3" value="test3 matches">
        <equals arg1="${test1}" value="$ $ $$ $$ $$$ $$$"/>
    </condition>
    <echo message="TEST #3: ${test3}"/> <!-- Prints "TEST #3: ${test3}-->
</project>

So, the value of the variable seems correct, but the echo is wrong.

However, this does work:

<project>
    <property name="dlr" value='$'/>
    <property name="test1" value="${dlr} ${dlr}${dlr}
${dlr}${dlr}${dlr} ${dlr}${dlr}${dlr}${dlr}
${dlr}${dlr}${dlr}${dlr}${dlr} ${dlr}${dlr}${dlr}${dlr}${dlr}${dlr}"/>
 <!-- Try single quotes -->
    <echo message="TEST #1 = ${test1}/>  <!-- Prints $ $$ $$$ $$$$
$$$$$ $$$$$$-->

    <condition property="test2" value="test2 matches">
        <equals arg1="${test1}" value="$ $$ $$$ $$$$ $$$$$ $$$$$$$"/>
    </condition>
    <echo message="TEST #2: ${test2}"/> <!-- Prints "TEST #2: test2 matches-->

    <condition property="test3" value="test3 matches">
        <equals arg1="${test1}" value="$ $ $$ $$ $$$ $$$"/>
    </condition>
    <echo message="TEST #3: ${test3}"/> <!-- Prints "TEST #3: ${test3}-->
</project>

So, by declaring a variable equal to "$" and using that instead of
dollar signs seems to work.

-- 
David Weintraub
qazw...@gmail.com

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

Reply via email to