![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Not access variable outside loop when a reading a file | ricardo.ludwig | Shell Programming and Scripting | 4 | 05-24-2009 12:14 AM |
| help with a 'while read' loop to change the names of files | starsky | Shell Programming and Scripting | 6 | 03-01-2008 01:47 PM |
| Reading 5 Students names and grades using while loop???? | dlbomber1 | Shell Programming and Scripting | 1 | 11-26-2007 02:46 AM |
| Variable names | Bab00shka | UNIX for Dummies Questions & Answers | 2 | 11-11-2005 11:45 AM |
| Variable assignment for file names. | jagannatha | UNIX for Dummies Questions & Answers | 2 | 05-29-2003 05:38 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Hi All ,
I am having confusion in a shell script. Please guide me. I need to get multiple files (number of files vary time to time, file names are separated by '|') using FTP get from the remote server. Actually, i call the FTP function in a loop. At the last step, i need to move all the get files to the target directory. <Sample Code> FILE_COUNT=`echo "${SOURCE_FILE}" | tr '|' '\n' | wc -l COUNTER=1 while [ ${COUNTER} -le ${FILE_COUNT} ] do FILE=`echo ${SOURCE_FILE} | cut -d '|' -f${COUNTER}` <FTP Function> if [[ ${COUNTER} = ${FILE_COUNT} ]] then mv <All the Source File Names> <Target Directory> fi done <Problem> How can I hold all the file names in a variable like below in the loop. FileNames=FileName1 FileName2 FileName3 ... FileNameN mv $FileNames $TargetDirectory Please help me how can i achieve. Thanks, Kanda. |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|