ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Lybarger" <>
Subject fail on telnet task
Date Thu, 08 Jan 2004 13:09:57 GMT
i have a target which runs the ant telnet task to execute a remote shell script. right now,
the only way i can figure out how to fail the ant task is if it hits a timeout waiting for
the a read that doesn't get there.  is there a way for the telnet task to capture the schell
script exit status and act upon it?

below are the task(s) and shell script i'm using.  if i run the status target with the timeout
in the status.test target, the status target doesn't execute because the command times out.
i realize the "Done" is never echoed.


  <target name="status.test" description="run remote script">
	<telnet userid="${jacobUserName}" password="${jacobPassword}" server="" timeout="10">
		<write>cd test</write>
		<write>bash ./ 1</write>
  <target name="status" depends="status.test" description="main testus target">
  	<echo>checked the status</echo>


# testing exit codes from remote ant.

echo "Starting the test status script" $1 > status.txt
exit $1
echo "Done"

Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (
Version: 6.0.557 / Virus Database: 349 - Release Date: 12/30/2003

View raw message