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: help with exec
Date Thu, 05 Jun 2003 11:57:44 GMT
On Thu, 5 Jun 2003 08:58 am, Lakshmi Vempati wrote:
> I am using exec task to execute a perl script that needs certain input.
>
> The code snipped I am using is as follows:
>
>   <exec dir="${dir}"
>          executable="${PERL_HOME}/bin/perl" >
>     <arg line="${SCRDIR}/templateFilter.pl" />
>     <arg line="domain=${domain}"/>
>     <arg line="&lt; ${SCRDIR}/tpl/StartServer.bat.tpl &gt;
> StartServer_${domain}.bat"/>
>    </exec>
>
> This seems to hang and never reach conclusion. If I add a timeout, then
> it quits after timeout. What am I doing wrong?
>

Under Unix, IO redirection is not performed by Perl - it is performed by the 
shell (Windows is the opposite). When Ant launches Perl, there is no shell 
involved. The last <arg> line there will pass four parameters to perl. The 
first and third will be  "<" and ">". This is not what you want. Since your 
perl script is trying to read from Standard input and Ant 1.5.x doesn't 
connect anything to standard input, everything hangs.

The workaround is to make the executable "sh" and pass the perl command using 
-c

Under Ant 1.6, you would be able to specify the input and output files in the 
<exec> task effectively allowing IO redirection.

Conor


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


Mime
View raw message