ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vvitayau <valdis.vitayau...@gmail.com>
Subject Re: AW: Checking a property with ant
Date Fri, 29 Oct 2010 17:06:46 GMT

I got failure when
                command="find . -maxdepth 1 -name ${reporting.db}.\*\.001 |
wc -l"/>

... the trick is why doesn't 0 -eq 0 is when it has EOL so adding pipe xargs
echo -n resolved this bug

hope this helps test your condition.

    <target name="db2-test">
        <sshexec host="${reporting.host}" trust="true"
username="${reporting.user}" password="${reporting.password}"
                outputproperty="reporting.backup.count" failonerror="true"
                command="find . -maxdepth 1 -name ${reporting.db}.\*\.001 |
wc -l | xargs echo -n"/>

        <condition property="missing.backup">
            <equals arg1="${reporting.backup.count}"    arg2="0"/>
        </condition>
    </target>

    <target name="testdb" depends="db2-test" unless="missing.backup">
        ...
    </target>

-- 
View this message in context: http://ant.1045680.n5.nabble.com/Checking-a-property-with-ant-tp1350385p3242389.html
Sent from the Ant - Users mailing list archive at Nabble.com.

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


Mime
View raw message