[lug] Telnet with here document

David Anselmi anselmi at anselmi.us
Wed Apr 6 19:10:02 MDT 2005


rm at fabula.de wrote:
> On Wed, Apr 06, 2005 at 01:35:47PM -0600, Stephen Queen wrote:
[...]
>>Once you said this I knew you were right, but I did find a
>>page that claimed you could do it.
>>
>>http://www.die.net/doc/linux/abs-guide/here-docs.html
> 
> Somehow i think this is just wrong.

It is.  The example is for ftp, which reads from stdin (and there's no 
need to process responses from the ftp server, while there might be from 
telnet).

If you didn't want to fool with expect you could use netcat instead of 
telnet.  But it doesn't necessarily handle the prompt/response style of 
telnet well.

Dave



More information about the LUG mailing list