On 07/23/2010 09:59 PM, Noah wrote:
> Hi there,
>
> I am trying to input a bunch of commands to an ssh session. One way to
> do it is to create a file and pipe it. Something like 'cat |
> ssh admin@' would work.
>
> But what If I just want to send a bunch of lines of text without
> creating a
On Fri, Jul 23, 2010 at 3:59 PM, Noah wrote:
> But what If I just want to send a bunch of lines of text without creating a
> file. How can I do it?
It's not a Perl solution, but you can just echo the lines to ssh...
echo 'line1
line2
line3' | ssh ...
Be sure to escape single quotes. :)
$ ech
On 7/23/10 Fri Jul 23, 2010 12:59 PM, "Noah"
scribbled:
> Hi there,
>
> I am trying to input a bunch of commands to an ssh session. One way to
> do it is to create a file and pipe it. Something like 'cat |
> ssh admin@' would work.
>
> But what If I just want to send a bunch of lines of te
2010/7/24 Noah :
>
> But what If I just want to send a bunch of lines of text without creating a
> file. How can I do it?
>
>
Try Net::SSH::Perl.
my $ssh = Net::SSH::Perl->new("host1");
$ssh->login("user1", "pass1");
$ssh->cmd("foo");
$ssh->cmd("bar");
SSH-2 fully supports ru
Hi there,
I am trying to input a bunch of commands to an ssh session. One way to
do it is to create a file and pipe it. Something like 'cat |
ssh admin@' would work.
But what If I just want to send a bunch of lines of text without
creating a file. How can I do it?
Cheers,
Noah
--