Hello All,
 
I am trying to open a telnet session to a unix machine called "viewserver" and execute a command , say "who", and dump its results on my dos-prompt using the foll. code (But i ran this code from winXP.):-
 
use Net::Telnet ();
    $t = new Net::Telnet (Timeout => 100,
                          Prompt => '/bash\$ $/');
                         
$username = "jenson";
$passwd = "abc";
    $t->open("viewserver");
    $t->login($username, $passwd);
   
    @lines = $t->cmd("who");
    print @lines;
It shows me an error :
timed-out waiting for command prompt at telnet.pl line 8.
 
In the documentation ... its mentioned that the login () function depends on the
"PROMPT" parameter ...
 
1. Do i need to increase my timeout-period?? i tried tht ... it doesnt help.
2. by default ... if I go from start->run and type "telnet viewserver" and then login ....
it goes to the korn shell ...
I tried renaming the word "bash" to "ksh" ... in the above script and it doesnt work ...
 
Can someone guide me with the "PROMPT" parameter ... i believe thats where the problem is ... ??
 
Any suggestions/look-up advises would be highly appreciated.
 
Thanks and Regards,
Jenson Samuel.
 


Stay in the know. Pulse on the new Yahoo.com. Check it out.
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to