Hi,

I'm checking if a file exists on a remote server and running awk on that file path to get the last field and comparing that with another variable to see if they are equal.

I'm getting errors while running the following ant script.

Error
====
[echo] file name: /bin/echo: /bin/echo: cannot execute binary file


=======
class org.apache.tools.ant.taskdefs.condition.Equals doesn't support nested text data ("arg1=${d...g2=${cg}")
=======

I have 2 questions

1. How to execute awk in ant script
2. How to check if two strings are equal or not in ant

Please let me know.


====================
<?xml version="1.0" encoding="UTF-8"?>
<project name="ui Deploy" basedir="." default="silent">

<taskdef resource="net/sf/antcontrib/antlib.xml">
<classpath>
<pathelement location="/appl/user/ant/lib/ant-contrib-1.0b3.jar" />
</classpath>
</taskdef>

<target name="silent">

<property name="cg" value="app.war.deployed" />
<exec executable="ssh" outputproperty="cw" failonerror="false">

<arg value="user1@server" />
<arg value="ls" />
<arg value="/export/appl/website/jbapp/testui/cluster01/webapps/app.war.deployed" />

</exec>

<exec executable="sh" outputproperty="dwar" failonerror="false">
<arg value="echo"/>
<arg value="${cw}" />
<arg value="|awk" />
<arg value="-F" />
<arg value="/" />
<arg value="'{print $NF}'" />

</exec>

<condition property="FileisAvail">
<equals> arg1="${dwar}" arg2="${cg}"</equals>
</condition>
<if>
<isset property="FileisAvail"/>
<then>
<echo file is available />
</then>

</if>


</target>

</project>

Thanks..