in reply to Re^2: Retrieving status data from a device with SSH 2 using Perl
in thread Retrieving status data from a device with SSH 2 using Perl

Because I guess that if I use Expect with the Net::OpenSSH commands, I have to work with the same incomplete answer as if I were using the commands directly.

You can use Net::OpenSSH to establish the connection to the remote machine and then run an interactive shell managed with Expect as follows:

my ($pty, $pid) = $ssh->open2pty() # and empty command line invokes a +shell! or die "unable to run remote shell"; my $expect = Expect->init($pty); $expect-> ...
Though, if that is all you need to do in the remote server, using Expect alone will be almost the same, the only difference is that you will have to take care of authentication also.
PS: Salva? Betanzos? Super López? I guess I'm not the only Spaniard here!

No, you are not, where are you from?

Replies are listed 'Best First'.
Re^4: Retrieving status data from a device with SSH 2 using Perl
by nmorenod (Novice) on Feb 17, 2010 at 16:16 UTC

    Ok, then both are valid for me :) Now it's time to deal with Expect, but my first approaches look good.

    No, you are not, where are you from?

    Que sí, medio madrileño medio toledano, pa'servirle...

    Thanks again

      Que sí, medio madrileño medio toledano, pa'servirle...
      Then, let me invite you to the social meeting of the Madrid Perl Mongers we are having tomorrow!

        I am currently doing my masters in Germany... so it is a bit difficult for me to go tomorrow to embajadores 62! -though it wouldn't be so bad, to avoid the snow for a couple of days :) - but thanks anyway... y pasadlo bien!