> I am new to Unix programming and I need help in writing
> a shell script to FTP to another site. I am having trouble entering the
> login name and the password from the script. I have tried just hard
> coding the name and password in the script but I can not get a line feed
> or carriage return after them so I do not know if it is even waiting for
> one. I am trying to avoid using the automatic login of TCP/IP and would
> rather have it done in a script with the login name and password either
> hard coded or passed as a command line argument to start the session.
> Any help would be greatly appreciated. Thanks alot.
#
# should work on BSDish UNIXes, can be made to work on SVR4ish UNIXes with
# a tiny bit of tuning.
#
# this code ain't supported.
#
FTPHOST=wuarchive.wustl.edu # FTP server
FILENAME=coolstuf.zip # name of file to get
FTPUSER=anonymous # FTP username
FTPPASS= # FTP password
echo "getting ${FTPHOST}:${GETFILEPATH}/${FILENAME} ..."
echo "quote user ${FTPUSER}
quote pass ${FTPPASS}
bin
prompt
cd ${GETFILEPATH}
get ${FILENAME}
" | ftp -n ${FTPHOST} 2>&1 >> /dev/null
echo "gotten."