ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jose Alberto Fernandez <JFernan...@viquity.com>
Subject RE: Exec arguments, pipes, and I/O redirection...
Date Tue, 05 Sep 2000 22:19:24 GMT


> -----Original Message-----
> From: Ken Wood [mailto:kwood@i2.com]
> 
> I guess I'm confused.
> 
> I'm doing
>   <exec executable="cat"
>         dir=".">
>         <arg line="etc/jsm.properties | sed -f
> tools/jsmprops_sedscriptfile > 
> application/server/log/jsm.properties" /> 
>   </exec>
> 
> Ant DOES 'cat etc/jsm.properties" but it barfs on the rest, because
> it apparently wants to interpret every token on the arg list as files:
> 
>      [exec] cat: cannot open |
>      [exec] cat: cannot open sed
>      [exec] cat: cannot open -f
>      [exec] cat: cannot open >
> 
> This example is trivial, but more generally it is quite common on Unix
> to execute a command and pipe the output through one or more programs,
> and
> sometimes redirect the output. In this case, we are creating a new
> file from a template using some regular expression pattern matching
> and replacements....
> 
> How do I uses pipes and IO re-direction in an 'exec' ???
>

You are trying to use OS specific features, (which are not portable).

Try using: "sh -c '.........'" or write a shell script that you can invoque
from ANT and that does all this work for you.

Jose Alberto

Mime
View raw message