dsx has asked for the wisdom of the Perl Monks concerning the following question:
is there a way to execute multiple ssh commands on a remote host and save each command output in a different scalar without using a module? i want execute all commands in the same ssh connection. i have tried to do something like that, but i don't know how to save the output in a scalar. is there a way to do that in this manner?
$check = <<'CMD'; for i in /home/* do echo $i done CMD open(SSH, "| ssh sshtest\@localhost -T"); print SSH $check; close(SSH) or die "$!";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: execute multiple commands over ssh (without module)
by moritz (Cardinal) on Feb 06, 2012 at 10:42 UTC | |
by dsx (Novice) on Feb 06, 2012 at 11:41 UTC | |
|
Re: execute multiple commands over ssh (without module)
by Anonymous Monk on Feb 06, 2012 at 10:45 UTC | |
by dsx (Novice) on Feb 06, 2012 at 11:58 UTC | |
by salva (Canon) on Feb 06, 2012 at 12:09 UTC | |
by dsx (Novice) on Feb 06, 2012 at 18:51 UTC | |
by salva (Canon) on Feb 06, 2012 at 21:28 UTC |