Here is a interactive ftp script, you can modify it to run batch
#!/usr/bin/ksh
clear
#
# Gather ftp information
#
echo "*******************************************************"
echo "* Generic ftp, provide complete responses to prompts. *"
echo "*******************************************************"
echo "Enter User Id for network: \c"
read user
echo ""
echo "Enter the password for id xxxxxx: \c"
read pswd
echo ""
echo "Enter local transfer directory: \c"
read locdir
echo ""
echo "Enter host filename (ex: xxxx.zipped.myfile) : \c"
read hfile
echo ""
echo "Enter local filename (ex: myfile.zip) : \c"
read lfile
echo ""
echo "Enter transfer type (get or put) : \c"
read ttype
echo ""
echo "Enter transfer mode (binary or ascii) : \c"
read tmode
echo ""
#
# Build ftp command file
#
# n is network address
# p is port address for ftp
echo "open nnn.nnn.nnn.nnn pp" >ftpmisc
echo "$user $pswd" >>ftpmisc
echo "lcd $locdir" >>ftpmisc
echo "$tmode" >>ftpmisc
if [ $ttype = "put" ]
then
echo "put $lfile '${hfile}'" >>ftpmisc
else
echo "get '${hfile}' $lfile" >>ftpmisc
fi
echo "bye" >>ftpmisc
echo "" >>ftpmisc
#
# Display command file and get user decision on run or quit.
# If run, run ftp with command file.
#
echo "*******************************************************"
echo "* If the ftp commands below look right, enter a 'y' *"
echo "* to continue with ftp or 'n' to quit. *"
echo "*******************************************************"
tail ./ftpmisc
echo ""
echo "Enter 'y' or 'n': \c"
read answer
if [ $answer = 'y' ]
then
echo "Running ftp......................."
ftp -inv < ftpmisc > ftpmisc.log
echo "ftp complete, review ./ftpmisc.log.........."
else
echo "Quiting ftp.................."
fi