ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Woo, Chen Ching" <c...@spss.com>
Subject RE: TelnetTask help needed!
Date Wed, 02 Oct 2002 14:25:10 GMT
I tried your script but the Ant still didn't seem to get pass the
  <read>C:\&gt;</read>
line.  It just keep waiting for the string.

Should it make any difference since I'm testing it using localhost.

Thanks.

chen.


-----Original Message-----
From: McHenry, Matt [mailto:mmchenry@carnegielearning.com]
Sent: Tuesday, October 01, 2002 6:02 PM
To: Ant Users List
Subject: RE: TelnetTask help needed!


	I had a lot of trouble getting this to work initially, too.  I don't
telnet to anything other than a win2k box, so I had attributed the flakiness
to the telnet task, but I'm more than willing to shift the blame to windoze.
;->

	What I eventually got to work (under 1.4, works w/o modification
under 1.5) is a combination of three things that seemed to alleviate the
flakiness:

 (1) immediately change the prompt to something that doesn't require any
ugly xml and/or java escapes

 (2) throw all the real commands you want to run on the remote machine into
a .bat file and just run that

 (3) add an extra 'echo' command at the end, because the telnet task seems
to be a bit overzealous in deciding that a session has terminated.

	Thus:

    <telnet userid="${login}" password="${passwd}" server="${ipaddr}">
      <read>C:\&gt;</read>
      <write echo="${echo-prop}">prompt dosprompt:</write>

      <read>dosprompt:</read>
      <write echo="${echo-prop}">build.bat</write>

      <read>dosprompt:</read>
      <write echo="${echo-prop}">echo</write>
      <read>dosprompt:</read>
      <write echo="${echo-prop}">exit</write>
    </telnet>

Matt McHenry
Software Developer
Carnegie Learning

> -----Original Message-----
> From: Woo, Chen Ching [mailto:cwoo@spss.com]
> Sent: Tuesday, October 01, 2002 10:09
> To: Ant Users List
> Subject: RE: TelnetTask help needed!
> 
> 
> Thanks Nick but it still doesn't work. 
> Has anyone ever tested this task on Windows ?
> 
> -----Original Message-----
> From: Boucart_Nick@emc.com [mailto:Boucart_Nick@emc.com]
> Sent: Tuesday, October 01, 2002 3:37 AM
> To: ant-user@jakarta.apache.org
> Subject: RE: TelnetTask help needed!
> 
> 
> Maybe you can try the reads and writes with their string attribute:
> 
> <telnet server="localhost">
> 	  <read  string="C:\>"/>
> 	  <write string="dir"/>
> 	  <read  string="C:\>"/>
> </telnet>
> 
> Hope this helps,
> 
> Nick.
>  
> 
> -----Original Message-----
> From: Woo, Chen Ching [mailto:cwoo@spss.com]
> Sent: Monday, September 30, 2002 9:16 PM
> To: Ant Users List
> Subject: TelnetTask help needed!
> 
> 
> I've the following script to use the Telnet task using Ant1.5 
> on win2000:
> 
> <project name="telnetTest" default="telnet">
> <target name="telnet">
> 	<telnet server="localhost">
> 	  <read>C:\></read>
> 	  <write>dir</write>
> 	  <read>C:\></read>
> 	</telnet>
>   </target>
> </project>
> 
> Ant seems to be waiting for the 'C:\>' input stream forever. 
> I know I must
> have
> done something wrong in the <read> sub-task.
> 
> Any help will be greatly appreciated.
> 
> Thanks.
> 
> chen.
> 
> --
> To unsubscribe, e-mail:   
<mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>

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


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


Mime
View raw message