Re: opening sftp command as a file
- From: Jim Gibson <jimsgibson@xxxxxxxxx>
- Date: Mon, 31 Mar 2008 11:01:05 -0700
In article
<f366c2e20803300113l104b95e9l72e48df34e135bd1@xxxxxxxxxxxxxx>, Kilaru
Rajeev <kilarurajeev@xxxxxxxxx> wrote:
Hi,
I am trying to run the following sub routine to copy a file from remote dir
to local. I am passing three arguments remote file, local file and the host
along with the user name. But, the program is not working. could somebody
please help me.
sub getFile {
my ( $rFile, $lFile, $rHost ) = @_;
my oldFile = $rFile.old;
The above line has several syntax errors in it.
open ( FH, "| sftp $rHost") or exception ( "Could not establish the sftp
connection");
print FH "get $rFile $lFile";
print FH "rename $rFile $oldFile";
print FH "exit";
close FH;
}
You should be posting a complete program that demonstrates the program.
Your program should have 'use strict;' and 'use warnings;' at the top.
The program above has syntax errors in it. You should cut-and-paste
your program instead of retyping it.
Please describe in what way the program "is not working".
Thanks.
--
Jim Gibson
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
.
- References:
- opening sftp command as a file
- From: Kilaru Rajeev
- opening sftp command as a file
- Prev by Date: Re: sort without ignoring hyphens
- Next by Date: Re: commify_series script in cookbook page 94
- Previous by thread: opening sftp command as a file
- Next by thread: parse x.500 DN and change order displayed
- Index(es):