in reply to Re: How to Read file from remote machine?
in thread How to Read file from remote machine?
On both client and server side it having Linux operating system. I have implemented it by using Net::SSH::Expect
#!/usr/bin/perl -w use strict; use Net::SSH::Expect; use Data::Dumper; my ($host,$user,$password) = ('172',"abc","xyz",); my $ssh = Net::SSH::Expect->new( 'host'=>$host, 'user'=>$user, 'password'=>$password, 'timeout' => 20 ); my $login_output = $ssh->login(); my $file = "/foo/boo"; $ssh->send("cat $file"); while (my $line = $ssh->read_line()) { print "Doing operation on $line\n"; }
But it is very slow, takes too much time to get connect with remote server and also take time to do "cat" of large file(~200mb).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: How to Read file from remote machine?
by salva (Canon) on Jul 21, 2014 at 13:26 UTC |