Sponsored Content
Top Forums Shell Programming and Scripting How to ftp multiple files by taking the file name from a input file. Post 302637599 by i.srini89 on Wednesday 9th of May 2012 04:16:21 AM
Old 05-09-2012
Data How to ftp multiple files by taking the file name from a input file.

Hi,

I'm working on a script which has to copy multiple files from one server to another server. The list of files that are to be copied is present in a file say input.txt.

Code:
vi input.txt
 
abc.c
welcome.c
new.c
welcome1.c

for ftp'ing a single file say 'new.c' the following code works fine.
Code:
    
    HOST="xxxxxx"
    USER='xxxxxxx'
    PASSWD='xxxxxx'
    FILE="new.c"
    ftp -inv $HOST <<END_SCRIPT
    quote USER $USER
    quote PASS $PASSWD
    cd $trgtpath
    lcd $curnt_dir
    binary
    prompt off
    mget $FILE
    bye
    ##quit
    END_SCRIPT
    ##exit 0

Please help me with looping through input.txt file and copying the files.

Also pls share the info on what <<END_SCRIPT signifies.

Thanks,
Srini
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Problem taking input from file with for loop

I am trying to take input from a file and direct it into a bash script. This script is meant to be a foreach loop. I would like the script to process each item in the list one by one and direct the output to a file. # cat 1loop #!/bin/bash # this 2>&1 to redirect STDERR & STDOUT to file... (4 Replies)
Discussion started by: bash_in_my_head
4 Replies

2. Shell Programming and Scripting

building output file from multiple input files

Hi there, I am trying to figure out a way to combine multiple sources with different data on a single file, and I am trying to find the best way to do it. I have multiple files, let's say A, B, C and D. A has a field in common with B, B has a field in common with C, and C has a field in... (2 Replies)
Discussion started by: ppucci
2 Replies

3. Shell Programming and Scripting

Create Multiple files by reading a input file and changing the contents

Being new to this area .I have been assigned a task which i am unable to do . Can any one please help me . Hi I have requirement where i have input file XYZ_111_999_YYYYMMDD_1.TXT and with header and series of Numbers and Footer. I want to create a mutiple output files with each file having a... (2 Replies)
Discussion started by: bhargavkr
2 Replies

4. Shell Programming and Scripting

Search & Replace in Multiple Files by reading a input file

Hi, I have a folder which contains multiple config.xml files and one input file, Please see the below format. Config Files format looks like :- Code: <application name="SAMPLE-ARCHIVE"> <NVPairs name="Global Variables"> <NameValuePair> ... (0 Replies)
Discussion started by: haiksuresh
0 Replies

5. Shell Programming and Scripting

Split a file into multiple files based on the input pattern

I have a file with lines something like. ...... 123_start ...... ....... 123_end .... ..... 456_start ...... ..... 456_end .... ..... 789_start .... .... 789_end (6 Replies)
Discussion started by: abinash
6 Replies

6. Shell Programming and Scripting

Installing a bin file by taking input from a properties file

I need to install a bin file in UNIX which requires user interaction for giving some information like user id , path, sid etc. All these information is stored in a properties file in the same location. So if i give ./file.bin -f propfile.properties will it install the file taking all the... (1 Reply)
Discussion started by: coolmohere
1 Replies

7. Shell Programming and Scripting

Script to delete files older than x days and also taking an input for multiple paths

Hi , I am a newbie!!! I want to develop a script for deleting files older than x days from multiple paths. Now I could reach upto this piece of code which deletes files older than x days from a particular path. How do I enhance it to have an input from a .txt file or a .dat file? For eg:... (12 Replies)
Discussion started by: jhilmil
12 Replies

8. Shell Programming and Scripting

Search & Replace in Multiple Files by reading a input file

I have a environment property file which contains: Input file: value1 = url1 value2 = url2 value3 = url3 and so on. I need to search all *.xml files under directory for value1 and replace it with url1. Same thing I have to do for all values mentioned in input file. I need script in unix bash... (7 Replies)
Discussion started by: Shamkamde
7 Replies

9. Shell Programming and Scripting

Copying a file to multiple other files using a text file as input

Hello, I have a file called COMPLIST as follows that contains 4 digit numbers.0002 0003 0010 0013 0015 0016 0022 0023 0024 0025 0027 0030 0031 0032 0033 0035 0038 0041 (3 Replies)
Discussion started by: sph90457
3 Replies

10. Shell Programming and Scripting

Search pattern in a file taking input from another file

Hi, Below is my requirement File1: svasjsdhvassdvasdhhgvasddhvasdhasdjhvasdjsahvasdjvdasjdvvsadjhv vdjvsdjasvdasdjbasdjbasdjhasbdasjhdbjheasbdasjdsajhbjasbjasbhddjb svfsdhgvfdshgvfsdhfvsdadhfvsajhvasjdhvsajhdvsadjvhasjhdvjhsadjahs File2: sdh hgv I need a command such that... (8 Replies)
Discussion started by: imrandec85
8 Replies
ftpservers(4)						     Kernel Interfaces Manual						     ftpservers(4)

NAME
ftpservers - ftpd virtual hosting configuration specification file SYNPOSIS
DESCRIPTION
The file is used to tell which set of virtual domain configuration files that the server should use. With support, wu-ftpd has the ability to use separate configuration files for each virtual domain. For a virtual host, configuration files can be placed into a separate virtual domain directory. The directory path and the virtual host IP address that is to use those configuration files is listed in the file. The actual configuration files put into the virtual domain direc- tory MUST be named as follows: virtual domain's access file. restrict the accounts that can use the web server." SITE GROUP and SITE GPASS support." allow or deny usernames access to that virtual server." customize conversions available in the virtual domain." You do not need to put every file in each of the virtual domain directories. If you want a set of domains to use the master copy of a file, for example, the file, then do not include that file in those virtual domain directories. In that case the default master copy will be used. The file names must match those listed above. If you misspell any of them or name them something else, the server WILL NOT find them and the master copy of them will be used instead. ftpservers File Format There are two fields to each entry. For example: When an ftp client connects to the server, tries to match the IP address the ftp client connected to with one found in the file. If a match is found the path to the specified directory containing the configuration files for that specific domain is returned. The server uses any configuration files in that directory. If a match is not found, or an invalid directory path is encountered, default paths to the configuration files are used. The use of in the example above fails the check for a specific directory and the master configuration files will be used. Either the actual IP address or a specific hostname can be used to specify the virtual domain. It is better to specify the actual IP of the virtual domain as it reduces the need for a domain lookup and eliminates DNS security related naming issues. Comment lines are depicted with a # sign. Both comment lines and blanklines are ignored. FILES
AUTHOR
was developed by the Washington University, St. Louis, Missouri. SEE ALSO
ftpd(1M) , ftpaccess(4) , ftpconversions(4) , ftphosts(4). ftpservers(4)
All times are GMT -4. The time now is 09:56 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy