CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Print issue

 



nanook
New User

Oct 7, 2013, 11:04 AM

Post #1 of 2 (738 views)
Print issue Can't Post

I'm trying to have my script show me various interfaces from my router, when I have it print, it is not printing the full output as there are at least 10 more lines. How can I fix this?


#!/usr/bin/perl -w

#use strict;
use warnings;
use Net::SSH::Expect;

my $ssh = Net::SSH::Expect->new (
host => "10.0.0.1",
user => 'user',
password => 'pass'
);
my $login_output = $ssh->login();
if ($login_output !~ /router #/) {
die "Login has failed. Login output was $login_output";
}
#$ssh->run_ssh() or die "SSH process couldn't start: $!";
$ssh->send("show int g2/1");
my $line;

while (defined ($line = $ssh->read_line()) ) {


Laurent_R
Veteran / Moderator

Oct 8, 2013, 11:46 AM

Post #2 of 2 (715 views)
Re: [nanook] Print issue [In reply to] Can't Post

As I said in my answer to your cross post on the DevShed forum, it seems you are suffering from buffering. Take a look at this: http://www.plover.com/FAQs/Buffering.html.

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives