I rewrote 2,650 lines of C as a seven line shell script. The previous programming team had written a data transfer program with its own implementation of ftp. I just used the one that was already on the computer.
echo "open $mainframe\
\nuser $mf_username $mf_password
\nsite lr=160\
\ncd ..\
\nmput \*\
\nquit" | ftp -i -n -v > $ftp_log 2>&1
The program collected data from the telephone company's Nortel MD110 switches, tidied it up and sent it to their mainframes.