SFTP using windows perl script

February 22, 2010 at 14:16:40
Specs: Windows XP
I need help in writing a windows PERL script that would trigger the windows SFTP

Here's my script but it's dying on the LCD line. Your help is truly appreciated. Thank you.

use strict;
my ($lawdir, $runcmd, $server, $prodline, $workdir);
my ($datadir, $pagecmd, $pagehdr, $stat, $cp, $FTPPATH, $SrvAdr);
###
### Send out EFT to XXX site
###
### start of script
###

use prodline;
($lawdir, $runcmd, $server, $prodline, $workdir,
$datadir, $pagecmd, $pagehdr) = &prodname($ARGV[0]);

Export $FTPPATH="-A:/*BIN";
Export $SrvAdr="ADW232222-send:sftp.blah.xxx.com";
sftp $SrvAdr;

### sftp $SrvAdr <<! 1>\\\\primus\\eft\\efttest.log;

lcd [D]:\law\apps\dev\mpidata\eft

#cd DEFTxxxxx-xxxxx70$FTPPATH;
#put eft.corp2.txt;

I've also tried the following line for the LCD line

lcd \\\\servername\\law\\apps\\dev\\mpidata\\eft

edited by moderator: Post moved from Windows XP Forum


See More: SFTP using windows perl script

Report •


#1
February 22, 2010 at 20:48:17
Felisa, suggest you post your query on the programming forum @:
http://www.computing.net/forum/prog...
you'll find a greater number of knowledgeable folks there.
HTH.
Ed in Texas.

Report •

#2
February 23, 2010 at 09:25:58
thank you. Will do.

Report •

#3
February 23, 2010 at 11:13:12
You're using the wrong approach.

This is what you should be using.
use Net::SFTP


Report •

Related Solutions

#4
February 23, 2010 at 11:24:15
Thank you. Do I need to rewrite the whole script? Aside from adding the Use Net::SFTP on top of my script, are the rest syntactically correct? Thanks again.

Report •

#5
February 23, 2010 at 12:42:01
You'll need to rewrite the script.

This is not valid Perl code:

Export $FTPPATH="-A:/*BIN";
Export $SrvAdr="ADW232222-send:sftp.blah.xxx.com";
sftp $SrvAdr;

### sftp $SrvAdr <<! 1>\\\\primus\\eft\\efttest.log;

lcd [D]:\law\apps\dev\mpidata\eft


Report •

Ask Question