nanomonk has asked for the wisdom of the Perl Monks concerning the following question:
Hi is it possible to execute multiple commands over one, persistent SSH Terminal Session using Perl and the ssh binary?
NB: I cannot use Perl SSH libraries, any of them.
I am scripting a remote server and I need to execute a few commands, I just want to open an SSH Session, execute multiple remote commands and grab the output like this from within Perl:
ssh user@host command1 -->output command2 -->output .. and so on exit
instead of
ssh user@host command1-->output ssh user@host command2-->output .. and so on
Each of the latter has connect/auth overhead I want to avoid.
I have searched alot but really don't know how to define what I am looking for, I am sure perl's excellent I/O can do it, just not sure how, as I usually just ue backticks becuase the scripts tend to be local, but this one requires a remote ssh terminal session.
Thanks, nano.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Persistent SSH Terminal from Perl?
by mikelieman (Friar) on Sep 26, 2008 at 17:32 UTC | |
|
Re: Persistent SSH Terminal from Perl?
by Illuminatus (Curate) on Sep 26, 2008 at 19:19 UTC | |
|
Re: Persistent SSH Terminal from Perl?
by nanomonk (Initiate) on Sep 27, 2008 at 08:13 UTC | |
by steelcarn99 (Initiate) on Jul 31, 2009 at 19:53 UTC | |
by salva (Canon) on Jul 31, 2009 at 21:03 UTC | |
|
Re: Persistent SSH Terminal from Perl?
by nanomonk (Initiate) on Sep 27, 2008 at 06:28 UTC | |
by Anonymous Monk on Sep 27, 2008 at 07:33 UTC | |
|
Re: Persistent SSH Terminal from Perl?
by Anonymous Monk on Sep 27, 2008 at 05:58 UTC |