Oh, and to most directly answer your question…
The tricky part of scripting FTP is getting the userid/password passed in. That’s because UNIX systems (like Mac OS X) use /dev/tty
for the input. So, you just need to tweak your shell script slightly to accommodate that.
See this working example.
—
Now, the drawback to FTP is that it operates in cleartext… even for your credentials! So a network sniffer could pickup your userid/password from the line if someone was suffficiently motivated to try.
Another concern is that, in order for this script to work, you’d need to embed the password in body of the script itself. Any users on your system with read access to that script could then see your “secret” credentials for the remote FTP host.
Neither of those might bother you much, especially if the FTP host is on your local network and you’re the only user on your machine. But it’s something to consider.