You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Rez <po...@hotmail.com> on 2008/11/20 21:31:47 UTC

Running exec tast

Hi
 
 
I can run the below command from a Windows cmd line just fine
cvs -f stat | grep "Repository revision" | gawk '{print $4 " " $3}'
but now I'd like to add it to my build.xml file in a target
 
<target name="stat"> <exec executable="cmd">  <arg value="/c"/>      <arg line="cvs -f stat | grep "Repository revision" | gawk '{print $4 " " $3}'"/> </exec></target>
 
I've changed the double quotes with &#34; and single quotes with &#39; and every other combination imaginable and I still get errors.  Please help.
 
 
Thanks
_________________________________________________________________
Access your email online and on the go with Windows Live Hotmail.
http://windowslive.com/Explore/Hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_access_112008

RE: Running exec tast

Posted by Rez <po...@hotmail.com>.
Thanks for the feedback.  After playing around persistently, I got it to work.  Please see below, either of the exec tasks work now:
 
 <target name="stat">    <exec executable="cmd">   <!--<arg value="/c cvs -f stat &#124; grep &quot;Repository revision&quot; &#124; gawk &apos;&#123;print &#36;4 &quot; &quot; &#36;3&#125;&apos;"/>-->   <arg value="/c cvs -f stat | grep &quot;Repository revision&quot; | gawk '{print $4 &quot; &quot; $3}'"/>  </exec> </target>
 
Rez> Date: Sun, 23 Nov 2008 21:11:06 +0000> From: james.abley@gmail.com> To: user@ant.apache.org> Subject: Re: Running exec tast> > 2008/11/20 Rez <po...@hotmail.com>:> >> > Hi> >> >> > I can run the below command from a Windows cmd line just fine> > cvs -f stat | grep "Repository revision" | gawk '{print $4 " " $3}'> > but now I'd like to add it to my build.xml file in a target> >> > <target name="stat"> <exec executable="cmd"> <arg value="/c"/> <arg line="cvs -f stat | grep "Repository revision" | gawk '{print $4 " " $3}'"/> </exec></target>> >> > I've changed the double quotes with " and single quotes with ' and every other combination imaginable and I still get errors. Please help.> >> > Hi,> > I think you need to experiment with redirectors[1] to see if you can> accomplish what you're trying to do. You're trying to use shell pipes,> which ANT doesn't know about. You need to explicitly send the output> of one <exec/> to another one. From my reading of the manual, I think> this should be possible.> > Cheers,> > James> > [1] http://ant.apache.org/manual/CoreTypes/redirector.html> > ---------------------------------------------------------------------> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org> For additional commands, e-mail: user-help@ant.apache.org> 
_________________________________________________________________
Color coding for safety: Windows Live Hotmail alerts you to suspicious email.
http://windowslive.com/Explore/Hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_safety_112008 

Re: Running exec tast

Posted by James Abley <ja...@gmail.com>.
2008/11/20 Rez <po...@hotmail.com>:
>
> Hi
>
>
> I can run the below command from a Windows cmd line just fine
> cvs -f stat | grep "Repository revision" | gawk '{print $4 " " $3}'
> but now I'd like to add it to my build.xml file in a target
>
> <target name="stat"> <exec executable="cmd">  <arg value="/c"/>      <arg line="cvs -f stat | grep "Repository revision" | gawk '{print $4 " " $3}'"/> </exec></target>
>
> I've changed the double quotes with " and single quotes with ' and every other combination imaginable and I still get errors.  Please help.
>

Hi,

I think you need to experiment with redirectors[1] to see if you can
accomplish what you're trying to do. You're trying to use shell pipes,
which ANT doesn't know about. You need to explicitly send the output
of one <exec/> to another one. From my reading of the manual, I think
this should be possible.

Cheers,

James

[1] http://ant.apache.org/manual/CoreTypes/redirector.html

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org