Srdjan Todorovic wrote:
This sounds like a job for expect. Expect a telent session, then send over the text file.
+1 on that: expect is a very useful tool that's often forgotten about (or not known about!). Indeed I haven't used it for ages and had forgotten its existence, so thanks for the reminder!