vonedaddy has asked for the wisdom of the Perl Monks concerning the following question:
I have been playing with perl on and off for the last year or so, but I am in no way a programmer, so bare with me if I explain my problems wrong.
I am using expect to login and run some commands on remote servers. The problem I am having is there is a large SSH banner which seems to confuse expect. It says: SSHAuthenticationError Login timed out. The input stream currently has the contents bellow: ****************************************************************************** Then the banner here.
Second problem I am having is, I have using the following code to read the output from commands and print it to the screen. But it never seems to read the last line of output. I am wondering if its because the last line is delayed? Is there a function to make the read line statement wait for a prompt back?
Thanks in advance.my $line; while ( defined ($line = $ssh->read_line()) ) +{ print $line . "\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Net::SSH::Expect - Reading stream and banner troubles.
by kcott (Archbishop) on Oct 13, 2010 at 12:47 UTC | |
|
Re: Net::SSH::Expect - Reading stream and banner troubles.
by Khen1950fx (Canon) on Oct 13, 2010 at 13:22 UTC |