Results 1 to 1 of 1
- 04-13-2017, 12:02 AM #1
Member
- Join Date
- Mar 2016
- Posts
- 5
- Rep Power
- 0
execute awk and compare strings in ANT script
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..
Similar Threads
-
A way to execute multiple queries from an SQL script file?
By _SAS in forum JDBCReplies: 5Last Post: 05-03-2012, 11:37 AM -
Execute sql script from java
By nikosdi in forum JDBCReplies: 0Last Post: 06-10-2011, 02:52 PM -
Compare between 2 Strings
By ChaosINC in forum New To JavaReplies: 3Last Post: 01-17-2010, 12:39 PM -
how to compare two strings
By elizabeth in forum New To JavaReplies: 7Last Post: 08-06-2007, 04:57 AM -
how do i run EXECUTE DBMS_MVIEW.REFRESH script from within java
By alexh in forum JDBCReplies: 0Last Post: 07-11-2007, 02:22 AM
Bookmarks