in reply to Re: Telnet Issue
in thread Telnet Issue
I am reposting my code again as per your request.
I have commented the Net::Telnet Object.
#!/usr/bin/perl -w
print "Enter the hostname you want to connect? \n" ;
$hostname = <>;
$telnet = `telnet $hostname `;
$telnet -> waitfor('/Username: $/i');
$telnet -> print('axiom');
$telnet -> waitfor('/Password: $/i');
$telnet -> print('axiom');
$telnet -> waitfor('/\$ $/i');
$telnet -> print('who');
$output = $telnet->waitfor('/\$ $/i');
print $output;
Thanks for your response.
I have commented the Net::Telnet Object.
#!/usr/bin/perl -w
print "Enter the hostname you want to connect? \n" ;
$hostname = <>;
$telnet = `telnet $hostname `;
$telnet -> waitfor('/Username: $/i');
$telnet -> print('axiom');
$telnet -> waitfor('/Password: $/i');
$telnet -> print('axiom');
$telnet -> waitfor('/\$ $/i');
$telnet -> print('who');
$output = $telnet->waitfor('/\$ $/i');
print $output;
Thanks for your response.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Telnet Issue
by ramlight (Friar) on Sep 03, 2009 at 19:49 UTC | |
by jag (Initiate) on Sep 04, 2009 at 08:41 UTC |
In Section
Seekers of Perl Wisdom