Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

problem in telnet script

4 views
Skip to first unread message

ngchowdhury

unread,
Jan 2, 2010, 8:16:02 AM1/2/10
to
Hi,
I have a small script to telnet into a IP address and execute a 'kill'
command, the script is running fine in one windows xp machine. In
another xp machine, it executes but does nothing. However when I run
the script with debug option ( -d) and just keep pressing 'n', it
executes fine.

The script is
----------------------------------------------------
use Net::Telnet;
$telnet = new Net::Telnet ( Timeout=>50, Errmode=>'die');
$telnet->open('192.168.1.1');
$telnet->waitfor('/Login: $/i');
$telnet->print('admin');
$telnet->waitfor('/Password: $/i');
$telnet->print('admin');
$telnet->print('kill 1');
-----------------------------------------------------
I tried with ActivePerl 5.8.9 as well as 5.10.1 thats comes with
distribution of cygwin.
Everywhere same problem, works fine with -d option - otherwise not.
Any idea ?

smallpond

unread,
Jan 5, 2010, 2:32:56 PM1/5/10
to

Have you tried either a waitfor or sleep between the password and the
command?

0 new messages