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 19:41:27 GMT
Hello,

glennm@ca.ibm.com wrote:
> 
> I haven't tried this, so YMMV, but how about
> 
> <exec executable="sed" output="./newfile">
>   <arg line="-e 's/bad/good/'" />
>   <arg line="&lt; oldfile" />
> </exec>
> 
> the resulting command line should look like
> 
> sed -e 's/bad/good/' < oldfile
> 
> with the output being redirected to newfile.

That won't work as the redirection operators < and > are implemented by
the shell not by sed.  Since he's executing sed directly you have to stick
to the arguments and parameters supported by sed.
	To do what you're suggesting, the following would have to be executed by
Ant:
	sh -c "sed 's/bad/good/' < oldfile"
But you don't need to do this because sed can take it's input file as an
argument.  See my prior response to his post.

-Bill Burton

> 
> Glenn McAllister
> Software Developer. IBM Toronto Lab, (416) 448-3805
> "An approximate answer to the right question is better than the
> right answer to the wrong question." - John W. Tukey
> 
> Please respond to ant-user@jakarta.apache.org
> 
> To:   ant-user@jakarta.apache.org
> cc:
> Subject:  Re: unix redirection - how do you specify input files?
> 
> >Ok your syntax is wrong try this
> ><exec executable="sed" output="./newfile">
> >     <arg line="-e 's/bad/good/'"/>
> ></exec>
> >This should work. Take a deeper look at the manual avaible at
> >http://jakarta.apache.org/ant/jakarta-ant/docs/.
> >
> >Yours Stefan S
> >
> 
> Thanks, I'll fix the <arg> syntax but it still doesn't answer
> the question of where the input file goes.  sed needs an input stream.
> 
> Steve D

Mime
View raw message