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

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Beginner:
Print issue


New User

Oct 7, 2013, 11:04 AM

Post #1 of 2 (1530 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 => "",
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

Post #2 of 2 (1507 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:


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

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