Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6864067
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:51:54+00:00 2026-05-27T02:51:54+00:00

My code as below use Net::SSH::Expect; my $ssh = Net::SSH::Expect->new ( host => $node_name,

  • 0

My code as below

use Net::SSH::Expect;

my $ssh = Net::SSH::Expect->new (
            host => "$node_name",
            user => 'admin',
            timeout => 10,
            raw_pty => 1,
            );

$ssh->run_ssh() or die "SSH process couldn't start: $!";

$ssh->waitfor('password: ');

$ssh->send("$password");

$ssh->waitfor('mml> ');

@ls=$ssh->exec("$command");

print @ls;

#BREAK1: At this point remote device ask for "Press Enter to continue..." because output is more than one page..that is why below code

while ($ssh->waitfor('continue')) {
$line=$ssh->send("\n");
print $line;
}

I want to print all the output captured, however it prints only which is captured by @ls=$ssh->exec("$command"); and it do not print anything which is captured by code below BREAK1.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T02:51:55+00:00Added an answer on May 27, 2026 at 2:51 am

    Perldoc of the module reccomends following when output is large:

     # When running a command that causes a huge output,
     # lets get the output line by line:
     $ssh->send("find /");   # using send() instead of exec()
     my $line;
     # returns the next line, removing it from the input stream:
     while ( defined ($line = $ssh->read_line()) ) {
         print $line . "\n";
     }
    

    Also note that send() is not supposed to return anything, you should use read_line() or read_all(). Module doc

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Below is part of the code use Net::Telnet; my $session = new Net::Telnet (Timeout
I'm trying to use the code below to send messages via System.Net.Mail and am
how to supress overright diaglog box when i use below code in asp.net, c#,
I am trying to use the below code to send email from asp.net(C#). using
I use code below to send file from ASP.NET Rest Api to client. Sometimes
I am using the below code to use xml loading in jsfiddle.net $.ajax({ type:
I use code below to read AssemblyTitle attribute of .NET apps, unfortunately Assembly.GetEntryAssembly() always
In the code below I use mpf_add to add the string representation of two
How to Remove Badge from the tabbar item i had use below code but
The code below is what I am trying to use in order to get

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.