ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Conor MacNeill <co...@cortexebusiness.com.au>
Subject Re: How to execute a command that reads from stdin
Date Sun, 09 Feb 2003 02:09:36 GMT
Zsolt Koppany wrote:
> Hi,
> 
> how can I execute a task from Ant that has to read from the stdin? I
> mean like in shell "cat < in.lst". I have to start a program that
> unfortunately does not understand a flag with a filename to read from.

I have just added the capability to the <exec> and <java> tasks to redirect 
input

<exec ... input="in.lst"/>

This will be part of Ant 1.6 - you can try it out from CVS or a nightly 
build. Of course prior to a 1.6 release, these features are subject to 
further development and change.

In the current version of Ant, you can execute a shell and redirect input in 
the command you give that shell. This example from Bug 3452 (Thanks David)

   <exec executable="cmd" os="Windows 2000" output="log.txt">
     <arg line="/c mysql &lt; init_db.sql>
   </exec>
   <exec executable="/bin/sh" os="Linux" output="log.txt">
     <arg line="-c mysql &lt; init_db.sql>
   </exec>

Conor


Mime
View raw message