Hacker News new | ask | show | jobs
by mrlyc 1279 days ago
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.
1 comments

Can you share this script? I'm interested to see how 2,650 lines of C got boiled down to seven lines of shell.
I just wrote

  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.