[lug] Telnet with here document

Stephen Queen svq at peakpeak.com
Sun Apr 10 14:46:51 MDT 2005



On Sun, 10 Apr 2005 rm at fabula.de wrote:

> On Wed, Apr 06, 2005 at 10:20:58PM -0600, Daniel Webb wrote:
> > On Wed, Apr 06, 2005 at 10:09:38PM +0200, rm at fabula.de wrote:
> >
> > > The expect solution Daniel posted does nothing more than attach to a
> > > pseudo-terminal and pipe the standard filehandles to the ptty.
> >
> > The solution I posted does what Stephen wanted.  Is there an easier way
> > to do it?
>
> Oh, this was just in the context of explaining telnet's use of
> (pseudo)ttys. Depending on Stephen's needs i think it might be much more
> convenient to do everything in expect. While the 'pass the ptty' approach
> might be just enough to issue a single command once a program/script needs
> to check the results/prompts from the other side expect is _much_ more simple.
> (and i wouldn't just send a bunch of commands over telnet ... never know
> what goes wrong on the other side ... :-)
>
RalfD's expect example was the easaiest to run with without
having to delve into a foreign scripting language too
deeply.

If I had to write a complex and durable piece of code, I
would have tried to understand the merits of the Perl script
and the other examples. But I just wanted to observe what
was going on inside a wireless access point for a few
minutes. I didn't want to invest a great deal of time
writing a bullet proof script. I do want to thank
everyone who responed though!

Thanks,
Stephen Queen



More information about the LUG mailing list