Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

for list task eats multiple dollar signs

Help
2011-08-17
2013-04-24
  • Chris Holman
    Chris Holman
    2011-08-17

    This script:

            <for delimiter="${line.separator}" param="lineOfTestLine" list="$$$ $$$ ${line.separator}$$$$$$ $$$$ ${line.separator}$$$$$$ $$$$">
                <sequential>
                    <echo level="info" message="lineOfTestLine: @{lineOfTestLine}" />
                </sequential>
            </for>
    

    Results in this output:

         [echo] lineOfTestLine: $ $ 
         [echo] lineOfTestLine: $$ $ 
         [echo] lineOfTestLine: $$ $
    

    Anyone know why its eating all those dollar signs?

    Regards,
    Chris

     
  • Chris Holman
    Chris Holman
    2011-08-18

    I've done some more digging and it seems that this is an ant "feature":

    <property name="lineOfTestLine" value="$ $$ $$$ $$$$ $$$$$ $$$$$$" />
    <echo message="${lineOfTestLine}" />
    

    Results in:

    [echo] $ $ $$ $$ $$$ $$$
    

    I've posted in the ant user forum.