Re: Calling Another Application From Perl
- From: Eric Pozharski <whynot@xxxxxxxxxxxxxx>
- Date: Mon, 18 Aug 2008 22:14:39 +0300
M <no_spam@xxxxxxxxx> wrote:
I want to call scp to transfer a file to another server.
Do some reading before.
open(OUT, "|scp $backup_file $user\@$server:./");
Use 3-arg B<open>. Check return value of B<open>. Use lexical
filehandles.
Consider B<Net::SSH>.
print OUT "$pass\n";
close OUT;
Since you write in filehandle, then check return value of B<close> too.
This does not work though. SCP does not allow to specify the password
rather it prompts for it. Is there anyway to answer the prompt for
password with perl?
B<Expect.pm>? (oops, too late).
p.s. oops, just gave B<apt-get> a try, and -- B<Net::SCP::Expect>
--
Torvalds' goal for Linux is very simple: World Domination
.
- References:
- Prev by Date: FAQ 4.71 How do I handle binary data correctly?
- Next by Date: Re: This is very OT, and its just a request. It has to do with Ashton Tate Framework 2/PC World contest in the 1980's
- Previous by thread: Re: Calling Another Application From Perl
- Next by thread: Re: This is very OT, and its just a request. It has to do with Ashton Tate Framework 2/PC World contest in the 1980's - Action_Memo_Scan_Composite.doc (1/8)
- Index(es):
Relevant Pages
|