Chris, I'm going to move this back to the list. Now that the problem is understood.
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. Scott -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 21, 2001 7:56 AM To: [EMAIL PROTECTED] Subject: Re: Telnet problem Scott, 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. Sincerely, Chris Gay "Scott Carlson" <[EMAIL PROTECTED] To: <[EMAIL PROTECTED]> stone.net> cc: Subject: Telnet problem 03/20/2001 01:00 PM Please respond to Scott.Carlson 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> <read>]$</read> <write echo="true">tar --extract --gunzip --file=fullmealdeal.tar.gz</write> <read timeout="0">]$</read> </telnet> </target>
