On Unix, any command can be done in a script, but a few
like FTP have the issue of an interactive password. It's not
the most secure thing in the world, but you can create a
$HOME/.netrc file to specify the login and password for
an ftp login. It MUST be given 600 permissions:
chmod 600 $HOME/.netrc
and should be of the format (on one line):
machine MACHNAME login YOURLOGIN password YOURPASSWD
where you substitute the target machine for MACHNAME,
your login name for YOURLOGIN, and your ftp password
for YOURPASSWD. Since the file is 600, others shouldn't
be able to read it. However, if you local account is
compromised, then your ftp site will be open to them.
Note that the password is transmitted in cleartext, so network
sniffers can see it too.