ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vvitayau <>
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="${}" 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"/>

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

View this message in context:
Sent from the Ant - Users mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message