Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

echo message with new line in nant

Tags:

nant

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"/>
like image 763
Dinesh Manne Avatar asked Jun 09 '09 13:06

Dinesh Manne


2 Answers

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

like image 139
eduffy Avatar answered Sep 18 '22 15:09

eduffy


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.

like image 44
MVH Avatar answered Sep 19 '22 15:09

MVH