tags:

views:

674

answers:

3

Does anyone know how to output a message using echo with a new line character, in the ant world i used ${line.seperator}, but i dont see any related property in Nant, nor any of the functions provided this info. I also tried the \n escape character but that was printed as it is. An examaple is below

<echo message="spool \n off \n quit" file="${scripts.list}" append="true"/>
+3  A: 

I don't know Nant, but the XML entity for newline is usually &#xa;

eduffy
Thanks, i was able to get it after the substitution, did not get the idea to use it even thought i knew it, however i would like to wait to see if anyone has any answers specific to Nant
Dinesh Manne
It works! Surprised there isn't a clearer method..
Thiru
A: 

you can just use newlines in the xml:

<echo message="Line1
Line2"/>
+3  A: 

In NAnt 0.90, I used the environment::newline() function to put in newlines where I wanted them. But since it's a little unwieldy to use ${environment::newline()}, I assigned it to a shortened property name that I could use throughout my script.

Unfortunately for 0.86 users, the environment::newline() function wasn't added till 0.90-alpha1.

MVH