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: DUH...Why can't I get AWK to work?
Date Thu, 15 Mar 2001 01:49:06 GMT
Larry,

Wildcard expansion under Unix is performed by the shell. It is not performed
by Ant so you are passing *.html straight to awk. You should probably change
the executable to /bin/sh and pass the awk command as an argument.

Conor


> -----Original Message-----
> From: Larry Yates [mailto:lyates1@adelphia.net]
> Sent: Thursday, 15 March 2001 12:25 PM
> To: ant-user@jakarta.apache.org
> Subject: DUH...Why can't I get AWK to work?
>
>
> For some reason, I can't get awk to work properly from Ant
> although it works
> OK from the command line. Everything 'looks' OK (i.e. the directory does
> contain html files)...
>
> Any ideas?
> Is there another way of making transformations (editing) on a
> list of files?
>
> Here's the relevant part of the build.xml file:
>    <target name="modify">
>       <property name="from" value="servlet/" />
>       <property name="to"   value="servletdemo/" />
>       <exec dir="${html}" executable="awk" os="NONSTOP_KERNEL" >
>         <arg line="'gsub(&quot;${from}&quot;,&quot;${to}&quot;)'
> ${html}/*.html"/>
>       </exec>
>    </target>
>
> and here's the log:
> modify:
>      [exec] Myos = NONSTOP_KERNEL
>      [exec] awk 'gsub("servlet/","servletdemo/")'
> /test/applications/demo/release2/html/*.html
>      [exec] awk: Cannot find or open file
> /test/applications/demo/release2/html/*.html.
>      [exec]
>      [exec]  The source line number is 1.
>      [exec] Result: 2
>
> BUILD SUCCESSFUL
>
> Thanks!
> -Larry
>
>


Mime
View raw message