1834604 Members
4633 Online
110069 Solutions
New Discussion

Utility like nc

 
SOLVED
Go to solution
Joydeep_1
Occasional Advisor

Utility like nc

Hi Gurus,

Do you know any utility like nc in BSD. Actually I want to take some output from one server's port & would like to store in variable.

When I am giving telnet abc 28000 | grep ok then output is coming .
ok
Connection closed by foreign host.

I want to get only ok value. I don't want "Connection closed by foreign host.". Is there any way or can I get any utility like nc ?
2 REPLIES 2
Deepak Extross
Honored Contributor

Re: Utility like nc

c=`telnet abc 28000 | grep ok`
echo $c | awk '{print $1}' ??
Steve Steel
Honored Contributor
Solution

Re: Utility like nc

Hi


Go to www.software.hp.com

choose public domain

look at

Netcat 1.10
=========== /\_/ / 0 0 Netcat is a simple Unix utility which reads and writes data ====v====
across network connections, using TCP or UDP protocol. \ W /
It is designed to be a reliable "back-end" tool that can | | _
be used directly or easily driven by other programs and / ___ \ /
scripts. At the same time, it is a feature-rich network / / \ \ |
debugging and exploration tool, since it can create almost (((-----)))-'
any kind of connection you would need and has several /
interesting built-in capabilities. Netcat, or "nc" as the ( ___
actual program is named, should have been supplied long ago \__.=|___E
as another one of those cryptic but standard Unix tools. /

In the simplest usage, "nc host port" creates a TCP connection to the given
port on the given target host. Your standard input is then sent to the host,
and anything that comes back across the connection is sent to your standard
output. This continues indefinitely, until the network side of the connection
shuts down. Note that this behavior is different from most other applications
which shut everything down and exit after an end-of-file on the standard input.


Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)