ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter Reilly" <peter.kitt.rei...@gmail.com>
Subject Re: ant run command piping and get out put to value
Date Mon, 12 Feb 2007 09:29:20 GMT
On 2/12/07, James Abley <james.abley@volantis.com> wrote:
> Probably something like:
>
> <exec executable="/usr/bin/svn">
>     <arg line="info" />
>     <arg line="|" />
>     <arg line="/bin/grep" />
>     <arg line="Revision" />
> </exec>
That will not work, the pipe etc are implemented  by a shell,
so try something like the following:

    <exec executable="sh">
      <arg line = "-c 'ls -rtla | grep build'"/>
    </exec>

or:
    <exec executable="sh">
      <arg value = "-c"/>
      <arg value="ls -rtla | grep build"/>
    </exec>
(note: in the second example, one does not need to use
single quotes, also this will probably not work in windows with
cygwin).

Peter

>
> Mr raju varghese wrote:
> > So how can i do it. tried the following way but it
> > does not recognize the pipe sybmol.
> > error is like Unexpected text ""|""
> >
> >
> > <exec executable="/usr/bin/svn" failonerror="true">
> > <arg line="info"/> </exec> | <exec
> > executable="/bin/grep" spawn="true"> <arg
> > line="Revision"/> </exec>
> >
> > --- Ninju Bohra <ninju_bohra@yahoo.com> wrote:
> >
> >> Hello,
> >>
> >> The <exec> task allows you execute any abritary
> >> commandline (including pipes) string.  The <exec>
> >> task also has a 'outputproperty' attribute that
> >> allows you define the name of a property whose value
> >> will be the output the commandline execution
> >>
> >>  Good Luck,
> >>
> >> Ninju
> >>
> >>
> >> ----- Original Message ----
> >> From: Mr raju varghese
> >> <rajuvarghese2000@yahoo.co.in>
> >> To: user@ant.apache.org
> >> Sent: Saturday, February 10, 2007 3:42:07 AM
> >> Subject: ant run command piping and get out put to
> >> value
> >>
> >>
> >> Hi,
> >>
> >> I need Ant to run some commands and save out put to
> >> a
> >> property value. how can i achive that. For example
> >>
> >> command:
> >> svn info | grep version
> >>
> >> I need to put output of the above command to
> >> property
> >> called 'svninfo'. And also how can i pipe commands
> >> using Ants exec.
> >>
> >> Thanks,
> >> Raju
> >>
> >>
> >>
> >>
> >>
> >>
> > ____________________________________________________________________________________
> >> Now that's room service!  Choose from over 150,000
> >> hotels
> >> in 45,000 destinations on Yahoo! Travel to find your
> >> fit.
> >> http://farechase.yahoo.com/promo-generic-14795097
> >>
> >>
> > ---------------------------------------------------------------------
> >> To unsubscribe, e-mail:
> >> user-unsubscribe@ant.apache.org
> >> For additional commands, e-mail:
> >> user-help@ant.apache.org
> >>
> >>
> >>
> >>
> > ____________________________________________________________________________________
> >> No need to miss a message. Get email on-the-go
> >> with Yahoo! Mail for Mobile. Get started.
> >> http://mobile.yahoo.com/mail
> >>
> >>
> > ---------------------------------------------------------------------
> >> To unsubscribe, e-mail:
> >> user-unsubscribe@ant.apache.org
> >> For additional commands, e-mail:
> >> user-help@ant.apache.org
> >>
> >>
> >
> >
> >
> >
> > ____________________________________________________________________________________
> > Looking for earth-friendly autos?
> > Browse Top Cars by "Green Rating" at Yahoo! Autos' Green Center.
> > http://autos.yahoo.com/green_center/
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> > For additional commands, e-mail: user-help@ant.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

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


Mime
View raw message