SUMMARY: telnet in script.

From: Loris Serena <Loris.Serena_at_esat.com>
Date: Fri Jul 30 2004 - 11:31:18 EDT
Guys, 

Thanks for your mails but I am not allowed to install ANYTHING on the box.
No perl.
No expect.
No nmap! ;-)


Thank you to... myself for this one:

#!/bin/sh
set -x

host=10.11.12.13
port=4567

( echo open ${host} ${port}
sleep 1
echo -e 3
echo exit ) | telnet -e 3



Loris



-----Original Message-----
From: Heilke, Rainer [mailto:Rainer.Heilke@atcoitek.com] 
Sent: 30 July 2004 16:27
To: Loris Serena
Subject: RE: telnet in script.


Then I think you're stuck. Expect is the only thing I know of that can
script an interactive command. Maybe others have heard of a built-in that
will do it, but I never have.

Aren't corporate rules so screwy sometimes?

Good luck.

Rainer Heilke

> -----Original Message-----
> From: Loris Serena [mailto:Loris.Serena@esat.com]
> Sent: Friday, July 30, 2004 9:20 AM
> To: Heilke, Rainer
> Subject: RE: telnet in script.
> 
> 
> Rainer,
> 
> I am not allowed to install ANYTHING on the box...
> telnet (or another command that ships with Solaris 9) are my
> only options...
> 
> Loris
> 
> 
> --
> 
> 
> 
> -----Original Message-----
> From: Heilke, Rainer [mailto:Rainer.Heilke@atcoitek.com]
> Sent: 30 July 2004 16:18
> To: Loris Serena
> Subject: RE: telnet in script.
> 
> 
> For something like this, you'll need Expect. It's a language
> to deal with
> interactive programs in a script. There's a Perl Expect module, too.
> 
> Rainer Heilke
> 
> > -----Original Message-----
> > From: sunmanagers-bounces@sunmanagers.org
> > [mailto:sunmanagers-bounces@sunmanagers.org] On Behalf Of
> Loris Serena
> > Sent: Friday, July 30, 2004 8:58 AM
> > To: 'sunmanagers@sunmanagers.org'
> > Subject: telnet in script.
> > 
> > 
> > Sunmanagers,
> > 
> > I'm trying to put together a little script to test TCP connectivity 
> > to a remote host on a specific port.
> > 
> > >From the command line, that would be something like:
> > $ telnet 10.11.12.13 4567
> > Trying 10.11.12.13...
> > Connected to 10.11.12.13.
> > Escape character is '^]'.
> > ^]
> > telnet> quit
> > Connection to 10.11.12.13 closed.
> > $ echo $?
> > 0
> > $
> > 
> > 
> > But how do I put this into a script?
> > 
> > Thanks in advance
> > 
> > Loris
> > 
> > 
> > 
> > 
> > 
> > 
> > Esat Telecommunications Limited
> > is a wholly owned subsidiary of BT Group plc
> > Registered in Ireland, Registration No. 141524 
> > Grand Canal Plaza, Upper Grand Canal Street, Dublin, Ireland 
> > 
> > This electronic message contains information (and may contain
> > files) from
> > Esat Telecommunications Limited which may be privileged or
> > confidential. The
> > information is intended to be for the sole use of the 
> individual(s) or
> > entity named above. If you are not the intended recipient be
> > aware that any
> > disclosure, copying, distribution or use of the contents of 
> > this information
> > and or files is prohibited. If you have received this 
> > electronic message in
> > error, please notify us by telephone or email (to the numbers 
> > or address
> > above) immediately. http://www.esatbt.com
> > _______________________________________________
> > sunmanagers mailing list
> > sunmanagers@sunmanagers.org
> > http://www.sunmanagers.org/mailman/listinfo/sunmanagers
> > 
> 
> 
> 
> Esat Telecommunications Limited
> is a wholly owned subsidiary of BT Group plc 
> Registered in Ireland, Registration No. 141524 
> Grand Canal Plaza, Upper Grand Canal Street, Dublin, Ireland 
> 
> This electronic message contains information (and may contain
> files) from
> Esat Telecommunications Limited which may be privileged or 
> confidential. The
> information is intended to be for the sole use of the individual(s) or
> entity named above. If you are not the intended recipient be 
> aware that any
> disclosure, copying, distribution or use of the contents of 
> this information
> and or files is prohibited. If you have received this 
> electronic message in
> error, please notify us by telephone or email (to the numbers 
> or address
> above) immediately. http://www.esatbt.com
> 



Esat Telecommunications Limited 
is a wholly owned subsidiary of BT Group plc 
Registered in Ireland, Registration No. 141524 
Grand Canal Plaza, Upper Grand Canal Street, Dublin, Ireland 

This electronic message contains information (and may contain files) from
Esat Telecommunications Limited which may be privileged or confidential. The
information is intended to be for the sole use of the individual(s) or
entity named above. If you are not the intended recipient be aware that any
disclosure, copying, distribution or use of the contents of this information
and or files is prohibited. If you have received this electronic message in
error, please notify us by telephone or email (to the numbers or address
above) immediately. http://www.esatbt.com
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
Received on Fri Jul 30 11:31:44 2004

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:43:36 EST