ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Scott Carlson" <>
Subject RE: Telnet problem
Date Wed, 21 Mar 2001 16:09:40 GMT
   I'm going to move this back to the list. Now that the problem is

   The <read/> scans all the output for the text.  In the docs, I do read in
only 2 chars from the prompt, it could be more, that is simply a stylistic
choice on my part.  You do need some assumptions based on the the current
shell, or on the output of the command.  So if you did a
<write>tar blah blah;echo +++done+++</write>
you could wait on <read>+++done+++</read>, because it will appear on the
output after the command finishes.

I will try to patch up the doc to make this clearer.


-----Original Message-----
From: []
Sent: Wednesday, March 21, 2001 7:56 AM
Subject: Re: Telnet problem

Thank you for replying, I appreciate it.

No, I do not have a read command after every write command, so therein lies
the problem.  However, what are the rules for the read command?  What does
the telnet task require to be read in?  The last char of the current line?
The last char of the next line? The whole line?  In the documentation
example, the first char is never read, and in your example below, you
appear to read only the last 2 chars.

When reading, must I make some assumptions?  For instance, if the response
to a write command is a given set of characters comprising a command
prompt, must I assume a given shell to guarantee the correct characters are
read in?

Thank you very much for your time.

Chris Gay

                    "Scott Carlson"
                    <Scott.Carlson@corner        To:     <>
          >                   cc:
                                                 Subject:     Telnet problem
                    03/20/2001 01:00 PM
                    Please respond to

I tried this bit of XML, which should replicate your problem.
I see no problems on my machine.  Do you have a read after your
write command? If you don't this is a problem.  You need a read
there or the task will close the session before the command
completes. (Or before it extracts both files.)

  <target name="bug" depends="init">
     <telnet timeout="5" userid="carlson" password="xxxxx" server="xxxxx">
         <read string="]$"/>
         <write echo="false">cd /home/carlson/java/ant</write>
echo="true">tar --extract --gunzip --file=fullmealdeal.tar.gz</write>
         <read timeout="0">]$</read>

View raw message