Don't for get to use " for the " char and ' for the ' char in your 
ant source
>> -----Original Message-----
>> From: Steve Loughran [mailto:[EMAIL PROTECTED]
>> Sent: Thursday, January 10, 2008 5:30 AM
>> To: Ant Users List
>> Subject: Re: an input for ant arg.
>>
>> Chun Ji wrote:
>>
>> >    <target name="migration">
>> >       <exec executable="java" dir=".">
>> >           <arg line="..."/>
>> >           <arg line="Test `grep "^where keyp_clientid in"
>> input.sql | awk '{print $4}'` "/>
>> >       </exec>
>> >       <xslt .../>
>> >    </target>
>> > ...
>> > "
>> > The error msg is: Element type "arg" must be followed by
>> either attribute specifications, ">" or "/>"
>> >
>> >
>> >
>> > So what should I do to solve this issue ? Any comments is welcome!
>> >
>>
>> The problem is the second <arg> statement has way too many
>> quotes in the line attribute for XML to handle. This an XML
>> problem, not an ant one.
>> You can use paired single quotes
>>
>>         line='some "inner" thing'
>> or double
>>         line="some 'other' thing"
>> but you cant have the same quotation type inside as out.
>>
>> Try creating the string from a couple of properties
>> <property name="grep" value='"^where keyp_clientid in"' />
>> ..and build these up
>>
>> of course, when you do that you'd find that the pipe,  the
>> grep and the awk wouldnt work, as they are shell commands.
>> You'd need to run bash.
>> Much better to
>>   -create at an outputredirector for the output
>>   -create a filterchain in the outputredirector that did your search
>>
>> -steve
>>
>> --
>> Steve Loughran
>> http://www.1060.org/blogxter/publish/5
>> Author: Ant in Action           http://antbook.org/
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED] For
>> additional commands, e-mail: [EMAIL PROTECTED]
>>
>>

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

Reply via email to