Home: Perl Programming Help: Beginner:
Print issue

New User

Oct 7, 2013, 11:04 AM

Views: 2359
Print issue

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 => "",
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()) ) {

Veteran / Moderator

Oct 8, 2013, 11:46 AM

Views: 2336
Re: [nanook] Print issue

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.