I want to download multiple files from ftp with a shell script. Up to now I always had all the files in one folder "/data". I used this script:
#!/bin/sh
HOST='abc.de'
USER='abc'
PASSWD='abc'
FILE='*.txt'
LOCDIR='/athome/abc/'
PATH='data/'
/usr/bin/ftp -n $HOST <<END_SCRIPT
quote USER $USER
quote PASS $PASSWD
lcd $LOCDIR
prompt off
binary
ls
cd $PATH
mget $FILE
quit
END_SCRIPT
exit 0
Now I have multiple subfolders in the folder /data
/data
/subfolder 1
/file1
/file2
/subfolder 2
/file1
/file2
/file3
...
how can I go through all these folders in a loop to download the containing files?
Thank you!