This is an implementation of a line-based telnet client, written as a bash script. Yes, it really can be done. Perhaps bash is too clever after all.
Here: http://people.redhat.com/twaugh/ftp/pmt/.