ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Burton" <bi...@progress.com>
Subject Re: unix redirection - how do you specify input files?
Date Thu, 21 Dec 2000 23:23:21 GMT
David Corbin wrote:
> 
> Bill Burton wrote:
> > >     Where does the input file belong in the Ant syntax?
> > >     As an <arg>?  That doesn't seem to work.
> >
> > The real question is, where does the input file belong in the sed syntax?
> > Sed will take input either from stdin or a file.  So just specify the file
> > after the pattern:
> >         <exec executable="sed" output="newfile">
> >           <arg value="-e"/>
> >           <arg value="s/bad/good/"/>
> >           <arg value="oldfile"/>
> >         </exec
> >
> A fine solution for sed, but what about other tools that ONLY deal with
> stdin (stupid though they may be).

Yes, that's a limitation with the <exec> task not allowing stdin to be
redirected.  One work around is to run the command through the shell:
	<exec executable="sh" output="newfile">
	  <arg line="-c &quot;sed 's/bad/good' < oldfile&quot;"/>
	</exexc>

For NT, it would be similar:
	<exec executable="cmd" os="Windows NT" output="newfile">
	  <arg line="/c &quot;some-command < oldfile&quot;"/>
	</exexc>

-Bill Burton

> 
> David Corbin
> Mach Turtle Technologies, Inc.
> http://www.machturtle.com
> dcorbin@machturtle.com

Mime
View raw message