Posted by Pedro Graca on 12/23/05 13:17
_andrea.l wrote:
> I'm writing a little script for reading information from a router by telnet.
> I have a problem
>
> How give a comand and get the answer more times?
<snip>
> The program don't exit from while...
> ... because the telnet don't give feof.
> Hoh can I do?
When you telnet to the router 'by hand', how do you know the router has
finished the answer and is ready for more?
You have to make your script follow the same rules.
A long time ago I did a script that telnets to a POP3 server.
Have a look:
http://groups.google.com/group/comp.lang.php/msg/ddffcd16c5b5f02f
and modify to your taste.
--
Mail to my "From:" address is readable by all at http://www.dodgeit.com/
== ** ## !! ------------------------------------------------ !! ## ** ==
TEXT-ONLY mail to the whole "Reply-To:" address ("My Name" <my@address>)
may bypass my spam filter. If it does, I may reply from another address!
Navigation:
[Reply to this message]
|