On 7/9/2011 2:46 PM, Irfan Sayed wrote:
modified the code.
my $t = new Net::Telnet (Timeout => 20,
Prompt => '/bash\$ $/',
Dump_Log => $filename,
Input_log => $file,
Errmode => $errmode,
Host => $host,
Input_record_separator => "\n",
Output_record_separator => "\n",
);
$t->open("$host");
$t->login($username, $passwd);
my @lines = $t->cmd("ls");
print "@lines\n";
my $ok = $t->print(@lines);
print "$ok\n";
in this code also , i am expecting @lines should print the contents
of "ls" command
when i execute this code , it just execute without any error
but the content of @lines are NULL
the dump_log and input_log says , it has successfully connected to
remote server and executed the "ls " command but @lines does not
contain any output of "ls" command/
this is also not happening
plz suggest
I have a suspicion that your prompt is not being matched, and then you
are timing out.
You may find that if you aren't seeing what you need to troubleshoot
this in the logs that using wiresharrk to capture the network traffic
might help.
http://www.wireshark.org/
John
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/