You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Stefan Bodewig <bo...@bost.de> on 2000/10/20 14:18:57 UTC

Re: How can I append files from exec?

>>>>> "JA" == Johan Adelöw <jo...@corustechnologies.com> writes:

 JA> Is there some way to append to a file when using the exec target

No, none at the moment.

 JA> Ive tried to do like this

 JA> <exec executable="sh" dir="${exec_dir}./" output="${os_log}"
 JA>       failOnError="true"> 
 JA>    <arg value="&quot;cat ${tmplogfile}: &gt;&gt; ${logfile}&quot;"/>
 JA> </exec>

 JA> When I do like this (on linux) the cat command isn't executed.

because there is a <arg value="-c" /> missing (as the first arg).

You don't need to specify the output attribute in the cat case BTW.

Stefan

Re: How can I append files from exec?

Posted by Stefan Bodewig <bo...@bost.de>.
>>>>> "JA" == Johan Adelöw <jo...@corustechnologies.com> writes:

 JA> I still can't make it work 

[...]

 JA> <arg value="&quot;cat ${tmplogfile}: &gt;&gt; ${logfile}&quot;"/>

My fault, the &quot;s are superfluos, sorry.

    <exec executable="sh">
      <arg value="-c" />
      <arg value="cat ~/.antrc &gt;&gt; /tmp/test.antrc" />
    </exec>

works for me.

Stefan

RE: How can I append files from exec?

Posted by Johan Adelöw <jo...@corustechnologies.com>.
I still can't make it work

<exec executable="sh" dir="${exec_dir}./" failOnError="true">
			<arg value="-c" />
			<arg value="&quot;cat ${tmplogfile}: &gt;&gt; ${logfile}&quot;"/>
		</exec>

[exec] /usr/bin/sh: cat /home/jad/project/repbld_error_logs/error.log: >>
/home/jad/project/repbld_error_logs/repbld.log:
No such file or directory

-----Original Message-----
From: Stefan Bodewig [mailto:bodewig@bost.de]
Sent: den 20 oktober 2000 13:19
To: ant-user@jakarta.apache.org
Subject: Re: How can I append files from exec?


>>>>> "JA" == Johan Adelöw <jo...@corustechnologies.com> writes:

 JA> Is there some way to append to a file when using the exec target

No, none at the moment.

 JA> Ive tried to do like this

 JA> <exec executable="sh" dir="${exec_dir}./" output="${os_log}"
 JA>       failOnError="true">
 JA>    <arg value="&quot;cat ${tmplogfile}: &gt;&gt; ${logfile}&quot;"/>
 JA> </exec>

 JA> When I do like this (on linux) the cat command isn't executed.

because there is a <arg value="-c" /> missing (as the first arg).

You don't need to specify the output attribute in the cat case BTW.

Stefan