Try using this:
Create a ".netrc" file that contains the following (the dot denotes invisable file) in the directory that your ftp script is.
machine ftp.server.name
login account_login
password password
set the permissions for the owner to have read and write access only
-rw-------
then create your shell script to ftp to the "machine" name in that file, it will automatically log in and perform whatever other commands you have in the script.
Hope that was clear enough, good luck!