At 2:57 PM -0500 12/21/00, 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).

I usually solve this by creating a shell script that pipes the file 
to the command.  From Ant you would launch a shell, passing it the 
name of the script and it's arguments.

The other alternative would be to create your own Ant Task, and call 
Runtime.exec() yourself.  The returned Process object contains the 
input and output streams of the process.

__________________________________
James Bucanek
<mailto:[EMAIL PROTECTED]>

Reply via email to