Sponsored Content
Top Forums Shell Programming and Scripting Need code to ftp files in loop Post 302527121 by Gangadhar Reddy on Thursday 2nd of June 2011 05:27:14 PM
Old 06-02-2011
Ravi,
Thanks a lot for your help. It worked. But I'm also trying some other option. For example storing sourcefile & targetfile name in a file and then reading it. This will help me if i want to add or get some other file names.

ftpfiles.txt
Quote:
JKA.CAD.TUV.ST082008,ABC082008.DAT
JKA.CAD.TUV.ST092008,ABC092008.DAT
JKA.CAD.TUV.ST102008,ABC102008.DAT
I will read the file like this
Code:
while read source_file target_file
        do
        get_files.sh $source_file $target_file
        fi
        done < ftpfiles.txt

Currently with above code in sourcefile variable I'm getting JKA.CAD.TUV.ST082008,ABC082008.DAT. How can I get sourcefile as JKA.CAD.TUV.ST082008 and targetfile as ABC082008.DAT

---------- Post updated at 05:27 PM ---------- Previous update was at 01:18 PM ----------

Please ignore the new reuest. I figured it out.

Just have to set the IFS variable
Code:

OLDIFS=$IFS
IFS=,


 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Ftp code problem

Hello I am trying to write a script that sends files via ftp from one server to another, i am using AIX 5.1. and bash shell to write my code. I get an error when trying to run the following lines of code ftp -n aptsbou01 <<! user $username $password binary ... (4 Replies)
Discussion started by: kswaraj
4 Replies

2. Shell Programming and Scripting

ftp in a for loop

All, ll, I am trying to ftp multiple files. I borrowed the ftp logic from existing script. When I enclose the ftp in a for loop, I get a syntax error "'<' unmatched" I checked all the variables I am using ... please help... TIA Rao files=$(ls ${LI_REPORT_FILE_PRE} ) for file in $files... (3 Replies)
Discussion started by: rao
3 Replies

3. Shell Programming and Scripting

FTP and run a loop for array problem

Hello, I have a problem with my script whereby it does not want to loop. The function of my script is to FTP into a server and go to each directory/volume in the array 'VOL'. The way the loop is suppose to work, is to go into the first volume, get the files of R(yesterday's date) and... (3 Replies)
Discussion started by: tuffgong2008
3 Replies

4. Shell Programming and Scripting

Loop certain code to all files within directory

Hi all, Can somebody help me with this problem pls. I need to extract one specific line from each files in a folder and put the all lines extracted in a unique output file in the following format. line extracted, respective name of file, date of file. I´m, trying the part to extract... (3 Replies)
Discussion started by: cgkmal
3 Replies

5. Filesystems, Disks and Memory

Not able to FTP the files to a FTP server

Hi , We are facing a weird problem in our project. we need to send some xml & audio files to a remote FTP server from a Linux box, we are doing this in Perl script using Net::FTP->. Issue here is.. when FTPed the files using Perl scripts, only empty files ( 0 byte) are getting created on the... (2 Replies)
Discussion started by: kishorepotta
2 Replies

6. Shell Programming and Scripting

ftp transfer in a for loop

Frdz, i have scenorio like i have to open ftp connection in a for loop and connect to the other server and upload the file again and again till the for loop ends but i am getting problem when i use the following code. for i in `ls ${SOURCE_DIR}/` do FOLDER_NAME=`basename $i` for j in `ls... (4 Replies)
Discussion started by: KiranKumarKarre
4 Replies

7. Shell Programming and Scripting

Need help creating a script to FTP files to a server and then delete the files that were transfered.

I am trying to FTP files to a Windows server through my Linux machine. I have setup the file transfer with no problems but am having problem deleting those files from the Linux box. My current non-working solution is below. Any ideas, anyone?? :wall: Please be gentle, I'm fairly new to this... (4 Replies)
Discussion started by: jmalfhs
4 Replies

8. Shell Programming and Scripting

send files through ftp using proxy in a loop

Hi, I have a problem with sending files to ftp using proxy. When using this script: #!/bin/bash DIR=/dane_wz ftp -n -v 172.30.100.13 << EOF quote USER xxx@172.25.240.45 quote PASS xxxx passive cd $DIR quit EOFit works fine and I get connection with FTP server, but using the same in a... (2 Replies)
Discussion started by: vrolok
2 Replies

9. Shell Programming and Scripting

FTP script loop

Hi, I'm trying to login to 100 boxes using a script. I have a file called 'hosty' which has all the ip addresses. Is there a way I can pass the password to the script then move on to the next box ?Basically I'm trying to test my password on all the boxes. AIX machines.. Here's what I have... (2 Replies)
Discussion started by: Grueben
2 Replies

10. UNIX for Beginners Questions & Answers

How to see the status of all the ftp put & get files logs and curent ftp transfer status ?

How to see the status of all the ftp put & get files logs and curent ftp transfer status if any active ftp running in the background ? (2 Replies)
Discussion started by: i4ismail
2 Replies
VFS_CATIA(8)						    System Administration tools 					      VFS_CATIA(8)

NAME
vfs_catia - translate illegal characters in Catia filenames SYNOPSIS
vfs objects = catia DESCRIPTION
This VFS module is part of the samba(7) suite. The Catia CAD package commonly creates filenames that use characters that are illegal in CIFS filenames. The vfs_catia VFS module implements a character mapping so that these files can be shared with CIFS clients. This module is stackable. The parameter "catia:mappings" specifies the mapping on a per-character basis, see below. OPTIONS
catia:mappings = SERVER_HEX_CHAR:CLIENT_HEX_CHAR SERVER_HEX_CHAR specifies a 0x prefixed hexedecimal character code that, when included in a Samba server-side filename, will be mapped to CLIENT_HEX_CHAR for the CIFS client. The same mapping occurs in the opposite direction. Multiple character mappings are separated by a comma. EXAMPLES
Map server-side quotation-marks (") to client-side diaeresis (") on filenames in the [CAD] share: [CAD] path = /data/cad vfs objects = catia catia:mappings = 0x22:0xa8 Perform comprehensive mapping of common Catia filename characters: [CAD] path = /data/cad vfs objects = catia catia:mappings = 0x22:0xa8,0x2a:0xa4,0x2f:0xf8,0x3a:0xf7,0x3c:0xab,0x3e:0xbb,0x3f:0xbf,0x5c:0xff,0x7c:0xa6 Server-side filename to be translated (Note that the path delimiter "/" is not used here): aa:a*a?a"a<a>a|a Resulting filename, as seen by the client: aya-:-axaca"a<<a>>a|a CAVEATS
Character mapping must work in BOTH directions (server -> client and client -> server) to get unique and existing file names! A NOT working example: [CAD] path = /data/cad vfs objects = catia catia:mappings = 0x3a:0x5f Here the colon ":" is mapped to the underscore "_". Assuming a server-side filename "a:should_work", which is translated to "a_should_work" for the client. BUT the reverse mapping from client "a_should_work" to server will result in "a:should:work" - something like "file not found" will be returned. VERSION
This man page is correct for Samba versions from 3.5.0 to 4.0.6. AUTHOR
The original Samba software and related utilities were created by Andrew Tridgell. Samba is now developed by the Samba Team as an Open Source project similar to the way the Linux kernel is developed. New version written by Guenter Kukkukk kukks@samba.org Samba 4.0 06/17/2014 VFS_CATIA(8)
All times are GMT -4. The time now is 09:19 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy