see Ant Manual / core tasks / exec task

outputproperty
errorproperty
resultproperty

example =

<exec executable="${plinkexec}" resultproperty="rc.activate"
failonerror="false">
   <arg line="[EMAIL PROTECTED] -batch -i ${web.ppk}
                cd ${web.eartarget}/${order.project.name}/${lum};
                 ${kshscript.prefix} activate ${project} ${lum}
${zipfile} ${earfile}
     " />

... and later in script check the Returncode:

<if>
            <not>
                <equals arg1="${rc.activate}" arg2="0" />
            </not>
            <then>
                <echo>+++ RC Shellscript != 0 +++${line.separator}
!!</echo>
                <fail />
            </then>
        </if>


Regards, Gilbert
 

-----Original Message-----
From: Maninder Singh (GR/EIL) [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 12, 2006 1:05 PM
To: user@ant.apache.org
Subject: How to execute and assign the output of a command to a property
on runtime.

Hi All,
        I am novice to Ant. How do I execute a command from within Ant
and then assign the value to a property at run time?
Thanks in advance for the help.

Regards,
Maninder Singh



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to