#Non-interactive FTP session
#Modify the FTPHOST USERNAME and PASSWORD as needed
FTPHOST="10.1.1.1"
USERNAME="anonymous"
PASSWORD="df@cd.com"
echo $FTPHOST
(
for host in $FTPHOST
do
echo "
open $host
user $USERNAME $PASSWORD
cd /contrib
ls
close
"
done
) | ftp -i -n