xingjin3131 has asked for the wisdom of the Perl Monks concerning the following question:
This program could print out the "hhhhhhh" line. But it did not execute the command "who". And I did not figure out why. Could someone help me with it? Thanks a lot. PS: I tried to use $t->login('myusername','mypasswd'). It did not work either.# !/usr/bin/perl use Net::Telnet; $t=new Net::Telnet(Timeout=>30, Errmode=>'die'); $t->open('myhostname'); print "ssssssss\n"; $t->waitfor('/login: $/i'); $t->print('myusername'); $t->waitfor('/password: $/i'); $t->print('mypasswd'); print "hhhhhhhh\n"; my @myoutput=$t->cmd("who"); print @myoutput; print "ttttttt\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: how to login one host and execute commands on it?
by glide (Pilgrim) on Jan 11, 2008 at 17:26 UTC | |
by xingjin3131 (Novice) on Jan 11, 2008 at 21:02 UTC | |
|
Re: how to login one host and execute commands on it?
by NetWallah (Canon) on Jan 11, 2008 at 17:40 UTC | |
by xingjin3131 (Novice) on Jan 11, 2008 at 21:04 UTC | |
|
Re: how to login one host and execute commands on it?
by zentara (Cardinal) on Jan 12, 2008 at 14:29 UTC |