ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject Re: <exec> kicking my butt with something very simple
Date Fri, 05 Dec 2014 19:05:24 GMT
On 2014-12-05, Eric Fetzer wrote:

> I've tried all I can figure out to try on a simple unix command in
> redhat.  I can run the command line and it works fine, but ant can't
> run it to save its life:

> <exec executable="sort" dir=".">
>   <arg value="-u"/>
>   <arg value="existingFile"/>
>   <arg value=">"/>
>   <arg value="newFile"/>
> </exec>

> I've tried putting all the args together, putting some of the args
> together...  If I run it like this, I get "sort: stat failed: >: No
> such file or directory.

This is because stdout redirection is something the shell handles for
you on Unix and ant executes the command directly.

You can either use the task's output attribute to create newfile or
execute the command via the shell:

        <http://ant.apache.org/faq#shell-redirect-2>

Stefan

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


Mime
View raw message