Re: shell script

1999-04-11 Thread Peter L. Peres

On Sat, 10 Apr 1999, guy keren wrote:

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" | ..`

With current bash/telnet this does not work as expected. Telnet chokes if
its stdin is not a tty. I had to do things like `yes|telnet somewhere|...`. 

Peter





Re: shell script

1999-04-11 Thread Nir Soffer

On Sun, 11 Apr 1999, Peter L. Peres wrote:

 MYVARIABLE=`telnet some.host.name 1234 | grep "the interesting line" | ..`
 
 With current bash/telnet this does not work as expected. Telnet chokes if
 its stdin is not a tty. Ihad to do things like `yes|telnet somewhere|...`. 

Just use netcat then.

Regards,
Nir.

--
Nir Soffer * scorpios @ cs.huji.ac.il * http://www.cs.huji.ac.il/~scorpios/
"From the moment I picked your book up until I put it down I was
convulsed with laughter.  Some day I intend reading it."
-- Groucho Marx, from "The Book of Insults"
Mail me with the subject 'get pgp key' for my PGP Public Key





Re: shell script

1999-04-09 Thread guy keren

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





Re: shell script

1999-04-08 Thread Ariel Biener

On Thu, 8 Apr 1999, Mike wrote:


Use expect

--Ariel
 Hi all
 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.
 
 Thank you
 
 Mike
 
 
 
 

   +---+
   | Ariel Biener  |
   | e-mail: [EMAIL PROTECTED]   Work phone: 03-6406086 |
   | fingerprint = 07 D1 E5 3E EF 6D E5 82 0B E9 21 D4 3C 7D 8B BC |
   +---+