ftp command line clients support the configuration file
~/.netrc where you can configure credentials for remote systems, e.g.:
ftp legacy.system.example.org then you don't have to retype this information anymore.
If you need to do more automation, you can script
ftp via piping commands into it, e.g.:
$ cat pushit.sh
# complex logic to set
Sure, if the system does not support
ssh, it probably does not support ftps either - but you can try it (e.g. via ftp-ssl) if you need to secure your connection.
An alternative to one of the plain
ftp commands is to use
lftp, since it provides several features to automated login and command execution.
$ lftp -e 'source ~/login.lftp'
$ cat login.lftp
Note that this example automated password authentication to a SFTP sever which is not supported by the standard OpenSSH sftp client.
-e instructs lftp to execute the commands at startup and stay interactive.
Of course, such a lftp script mach also source other scripts, and also automatically disconnect from the server.
In contrast, with
-f lftp directly exits after executing the commands specified as argument or read from the specified file.