![]() |
|
|
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 |
| read list of filenames from text file and remove these files in multiple directories | fxvisions | Shell Programming and Scripting | 5 | 08-07-2008 04:59 PM |
| cd to multiple directories and gzipping files within | sunsysadm2003 | Shell Programming and Scripting | 0 | 10-30-2007 05:50 PM |
| get files from multiple directories using FTP | amit1209 | Shell Programming and Scripting | 2 | 09-26-2007 10:39 AM |
| copy multiple files in different directories | ken2834 | UNIX for Dummies Questions & Answers | 3 | 03-25-2007 02:35 PM |
| Search for files in multiple directories | ravikirankethe | UNIX for Dummies Questions & Answers | 7 | 10-29-2006 05:29 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
FTP multiple files to different directories
The script below is written to ftp files to different directories on the destination server, but I'm not sure whether I have written the code correctly or not.
Can anyone help me on this? #!/bin/sh FILE_NAMES="FileA FileB FileC" SERVER=xxxx USERID=abcd PASSWD=xxxxx FOLDER="/folders/sub1/ /folders/sub2/ /folders/sub3/" DIRECTORY=1; ( echo " open ${SERVER} user ${USERID} ${PASSWD} for folder in ${FOLDER}; do cd ${folder} COUNT=1; for filename in ${FILE_NAMES}; do if [ ${COUNT} -eq ${DIRECTORY} ]; then put ${filename} break; fi COUNT=`expr $COUNT + 1` done DIRECTORY=`expr $DIRECTORY + 1` done close " ) | ftp -i -n if [ $? -ne 0 ]; then echo "File Upload Failed" else echo "File Upload Completed" fi exit 0 Last edited by abrd600; 08-30-2004 at 05:33 AM.. |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|