Ftp using perl and getting the files based upon a configuration file
I have copied all the file names into one file called "sdk_link.txt" and
I am reading each file name from this and then copying to my local PC:
use strict;
use warnings;
use Net::FTP;
use File::Copy;
$Login = "root";
$Pwd = "shroot";
$ftpHost = "tcspava";
$ftpFolder = "/home/tcspava";
$ftp=Net::FTP->new($ftpHost,Timeout=>100);
if ($ftp)
{
print $ftp->message;
}
$ftp->login($Login,$Pwd);
print $ftp->message;
$ftp->cwd($ftpFolder);
print $ftp->message;
open FILE,"sdk_link.txt" or die $!;
while($test=<FILE>)
{ chomp($test);
#Copy the file
copy("$test","/testing");
} $ftp->quit;
Subscribe to:
Post Comments (Atom)
Popular Posts
About The Author
I am a software programmer working in India. I usually like to blog in my free time....Read More
Labels
- array
- auto
- awk
- bash
- books
- c
- c++
- compare
- copy
- cpu
- cut
- Data Structures
- dbx
- debugger
- dtrace
- explicit
- expr
- find
- fork
- ftp
- gdb
- grep
- head
- interview-question
- isql
- java
- join
- malloc
- match
- mdb
- memory
- memory leaks
- mv
- nawk
- One liners
- paste
- pattern match
- perl
- perl script
- perl-hashes
- perldoc
- plsql
- popen
- process
- ps
- regex
- rename
- replace
- reverse
- scp
- search
- sed
- shell
- shell variable
- shell-script
- shell-scripting
- solaris
- sort
- split
- sql
- stl
- string
- sybase
- table
- tail
- tar
- truss
- unix
- vector
- vi
- vim
- xargs
Search This Blog
Blog Archive
-
2013
(50)
- November (1)
- September (2)
- July (2)
- June (4)
- May (8)
- April (4)
- March (4)
- February (4)
- January (21)
-
2012
(50)
-
December
(50)
- Interesting perl One-liner
- Return type of malloc
- Moving a process from background to foreground
- Join every two lines in a file
- Compare two files and replace
- Print lines after every n lines in a file
- Delete duplicate lines in a file in Unix
- Delete comments from a C/C++ source file
- Searching multiple strings in VI editor
- Understanding C++ polymorphism
- Archiving files in a directory - tar command
- Changing the extension of large number of files
- Reverse a list of numbers stored in a variable
- Using The Perl Debugger
- Using awk to only print the matching lines in two ...
- Using awk to delete lines from a file which are pr...
- File comparisons using awk: Match columns
- AWK one-liner for multi-column comparision two uns...
- Print lines between two patterns in a file
- Using Perl's -F flag
- Ftp using perl and getting the files based upon a ...
- Print every character in a new line
- Extracting Range of lines in perl
- Print limited characters per a line
- Find and replace a string in all the files recursi...
- secure copy in a shell script
- Change format of a field using awk
- Join lines based on a pattern
- Join lines based upon the first field
- Join consequent lines in unix
- Check for perl modules installed
- Using Perl File::Find
- Executing Sql query in a Perl script
- Compare two files in Perl
- Sort unix processes by memory usage
- Shell Script for taking backup
- Sort file on columns and characters
- Truss using a process id
- Breaking an infinite loop in a shell script
- Removing duplicates from a line
- Split a line into 5 fields each into multiple lines
- Printing lines after a match is found
- Add the contents of one file into other based upon...
- sort contents of a file based upon the fields
- Add line just before the first match
- Count the number of occurrences of each letter by row
- Delete lines from a file
- extract the contents in between the tags
- extract the contents in between the tags
- Comparing two files using awk
-
December
(50)
Powered by Blogger.
Pages
Gallery
[フレーム]Contact Us
Popular Posts
-
I have two files File 1 contains 3 fields File 2 contains 4 fields The number of rows of File 1 is much smaller than that of File 2 I...
-
Normally while working on PL/SQL stored procedures , we use DBMS_TRACE for knowing about the values of various variables and put some print...
-
At times you need to specify different courses of action to be taken in a shell script, depending on the success or failure of a command. Th...
-
Below is a most simple command for Sorting Unix processes by highest memory usage: ps -eo pmem,pid,pcpu,rss,vsz,time,args | sort -k 1 -r ...
-
This question attempts to collect the few pearls among the dozens of bad C++ books that are released every year.Unlike many other programmin...
-
There are lot of ways where one can identify memory leaks and lots of blogs and materieals are available to help a designer to identify the...
-
This awk one-liner works for multi-column on unsorted files. Comparision is done based on 1st,2nd,3rd,4th of the first file and 1st,3rd,6th,...
-
File3 a c e File4 a 1 b 2 c 3 d 4 e 5 the one liner for comparing the first field of file4 with the first field of file3 is:...
-
In unix, if we run a process(a shell script).It will not return to the terminal untill the script ends. lets say there is a script temp.sh ...
-
Most of the time it is required that w eneed to rename the files in bulk. this can be done in many ways,Mostly people do it by writing a s...
0 comments: