On Thu, 8 Apr 1999, Alex Shnitman wrote:
> > Does anyone know how to connect to a remote host by telnet using a shell
> > script ?
> > I need to get some data using a telnet.
>
> man expect
> Should get you started in 15 minutes.
actually, you're throwing in a hammer when sometimes a small screwdriver
would fit.
or at least if this is for connecting to a port that requires no user name
or password, and one has a shell script that should only get this
addition, one might even do (using bourn shell, sh):
MYVARIABLE=`telnet some.host.name 1234 | grep "the interesting line" | ..`
using awk or sed or whatever in the end to extract the relevant data.
(not saying proposing 'expect' isn't a good idea).
guy