read file and ftp automation script

Red hat Enterprise linux es version 3 (f...
April 16, 2010 at 07:48:05
Specs: Linux
What's wrong with this script? I'm trying to read in a text file that lists filenames I want to get from FTP. For each filename listed in the text file, I want to get the file. I'm getting "unexpected token near 'done'" error.

server=""
username=""
passwd=""
while read LINEVAR
do
ftp -n $server
user $username $passwd
binary
get ${LINEVAR}.tar.gz
bye
done < loadfilelist.txt

Thank you. I'm I newbie-I appreciate your help.


See More: read file and ftp automation script

Report •

#1
April 16, 2010 at 11:58:11
I haven't used ftp in many years, but I think the commands to ftp must be embedded into a unix/linux here document.

Check out the last post of this thread:

http://www.computing.net/answers/un...


Report •
Related Solutions


Ask Question