using ftp in a shell script.

I am trying to ftp some files from a certain directory, but i got an invalid command. does anybody know why i got this error?

ftp -v -i -n <<SCRIPT
open servername
user
username password
cd /server/logs
for file in MCWAS*
do
put ${file} /home/test/${file}
done

bye
SCRIPT

Probably because a for loop is not a legal ftp command.

Not probably -- certainly.