ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lopez, William" <>
Subject RE: How to grab Telnet's output
Date Tue, 26 Aug 2003 13:11:44 GMT

I use the telnet task from a Win2K box to call a script on an AIX box...I
(Ant)capture the output in the log file

  <target name="create_ears_A3"
     <telnet userid="${id}" password="${pwd}" server="${prod2_A3}">
       <write>ls -la</write>
       <read string="..."/>

...called by bat file with the following...
ant -f telnet_A3A4.xml -l Misc_Logs\telnet.log -verbose 

...get the following output:
   [telnet] ls -la
   [telnet] > ls -la
   [telnet] total 219768
   [telnet] drwxr-xr-x   6 wasadmin wasadmin       4096 Jul 25 10:36 .
   [telnet] drwxr-xr-x  23 wasadmin wasadmin       4096 Apr 28 17:19 ..
   [telnet] -rw-r--r--   1 wasadmin wasadmin   15496937 Jul 21 08:31
   [telnet] drwxr-xr-x   3 wasadmin wasadmin        256 Jul 25 10:38

I believe the ssh tasks is the way to go, telnet is quirky...which is why I
had to make scripts on the AIX box and call them via telnet, instead of
directly entering the commands in telnet didn't always work.


-----Original Message-----
From: Roman Rytov [] 
Sent: Tuesday, August 26, 2003 3:24 AM
To: Ant Users List
Subject: How to grab Telnet's output

I need to figure out a remote dir's content. I decided to use Telnet. I
connect through Telnet session and call "ls -l" command. But is there a way
to catch the output?

Roman R

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

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

View raw message