XML is sensitive to quotes and ampersands. Try putting the arg line in a
properties file, and using the property in your build.xml. This will
save you the trouble of translating the quotes and ampersands into xml
friendly entities.

-Rob A

> -----Original Message-----
> From: Chon, Ae H [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, December 05, 2006 11:58 AM
> To: user@ant.apache.org
> Subject: Using 'exec' task with special characters in argument line.
> 
> Need help!
> 
> I'm having problems  getting trying to run a command in 
> windows using ant "exec" task:
> 
> In windows, I would would the following command:  cleartool find .
> -version "created_since(yesterday)&&!(created_since(now))" -print
> 
> I tried to simulate this using 'exec' task...but it doesn't 
> take special characters like amperstand or double quotes.
> 
> How do i get around this?  I tried to used CDATA but i get 
> the following message (see code below):  Class 
> org.apache.tools.ant.types.Commandline$Argument doesn't 
> support the nested "line" element
> 
> Which i understand...but how do i get around this?
> 
> <exec executable="cmd" os="${os.name}" failonerror="false"
> dir="${basedir}\..\..\..\..\Source" >
> <arg>
> <line><![CDATA[/c cleartool find . -version 
> "created_since(yesterday)&&!(created_since(now))" 
> -print]]></line> </arg> </exec>
> 
> thanks in advance,
> 
> Ae Hwa Chon
> Configuration Manager
>  
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to