[lug] Telnet with here document

rm at fabula.de rm at fabula.de
Wed Apr 6 14:09:38 MDT 2005


On Wed, Apr 06, 2005 at 01:35:47PM -0600, Stephen Queen wrote:
> > No way :-) Telnet doesn't read from standard in, it always tries
> > to read from the controlling terminal. This is a known nuissance,
> > fortunately eased by the existence of handy script libraries (for
> > Perl that would be Net::Telnet).
> > Of course, any serious old-time unixer will now suggest 'expect' [1]
> > writtn exactly do do what you want.
> 
> 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. All telnet clients i have looked at
interact with te controlling terminal (for example by switching into 
raw mode during the password entry ....). The expect solution Daniel posted
does nothing more than attach to a pseudo-terminal and pipe the standard
filehandles to the ptty. 

just my 0.02$

  RalfD




More information about the LUG mailing list