创建一个脚本通过perl将多个文件传递给winscp脚本,就像我的文件夹中有10个文件一样,我需要将每个文件传递给winscp脚本,
$get='file.txt';
#system('winscp.com /ini=nul /command "open sftp://c400597:Pandi@123@dev/ - hostkey=""ssh-rsa 2048 5c:07:0d:9f:c6:dd:41:62:b5:0a:e6:0c:c3:7a:94:2d""" "put $get" "exit"');
system('winscp.com /ini=nul /command "open sftp://c400597:Pandi@123@dev/ -hostkey=""ssh-rsa 2048 5c:07:0d:9f:c6:dd:41:62:b5:0a:e6:0c:c3:7a:94:2d""" "put $get" "exit"');
print "above statement executed 0\n";
#system('winscp.com /ini=nul /command "open sftp://c400597:Pandi@123@dev/ -hostkey=""ssh-rsa 2048 5c:07:0d:9f:c6:dd:41:62:b5:0a:e6:0c:c3:7a:94:2d"""');
#print "above statement executed 1\n";
#system('winscp.com /ini=nul /command "put "'.$get);
#print "above statement executed 2\n";
system ('winscp.com /ini=nul /command "exit"');
print "above statement executed 3\n";
#winscp.com /ini=nul /command "open sftp://user:password@example.com/ -hostkey=""ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx"""
# "get examplefile.txt d:\" "exit"
#system("$x." ".$y." ".$z") || die "cannot open";
#
}
closedir $db;
我需要将$ get变量传递给winscp脚本。
我已经厌倦了几种方法来达到这个要求,但我无法完成它可以帮助我吗?