Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 5 Mar 2015 13:27:16 +0000
From:      David Chisnall <theraven@FreeBSD.org>
To:        Slawa Olhovchenkov <slw@zxy.spb.ru>
Cc:        svn-src-head@freebsd.org, Baptiste Daroussin <bapt@FreeBSD.org>, Gleb Smirnoff <glebius@FreeBSD.org>, src-committers@freebsd.org, svn-src-all@freebsd.org
Subject:   Re: svn commit: r279603 - in head: bin/rcp usr.bin/rlogin usr.bin/rsh
Message-ID:  <08E91A87-E3FA-47AE-ABDC-C23CA1A55B4C@FreeBSD.org>
In-Reply-To: <20150305131448.GW48476@zxy.spb.ru>
References:  <201503042201.t24M1jDG009278@svn.freebsd.org> <20150305114828.GK17947@FreeBSD.org> <20150305122103.GA90978@zxy.spb.ru> <20150305122359.GM17947@FreeBSD.org> <20150305123016.GO48476@zxy.spb.ru> <20150305123053.GN17947@FreeBSD.org> <20150305123349.GP48476@zxy.spb.ru> <364175B2-D8E4-489C-91BF-C121EA3C4EB3@cl.cam.ac.uk> <20150305124246.GS48476@zxy.spb.ru> <113C6811-8C79-4E7F-A909-73D0F3F6315C@FreeBSD.org> <20150305131448.GW48476@zxy.spb.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
On 5 Mar 2015, at 13:14, Slawa Olhovchenkov <slw@zxy.spb.ru> wrote:
>=20
> In previos message -- silently return when telnet speak about used IP
> address and diagnostic messages. One simple command do many diagnostic
> information.

Okay, so check the return code.  Or pass -v if you want more verbose =
information:

$ nc -v foo.example.com 80
nc: getaddrinfo: nodename nor servname provided, or not known
$ nc -v localhost 80
nc: connectx to localhost port 80 (tcp) failed: Connection refused
nc: connectx to localhost port 80 (tcp) failed: Connection refused
nc: connectx to localhost port 80 (tcp) failed: Connection refused

Or even alias nc -v to telnet if you like typing more...

Or add -D, if you want more debugging information.

> I am know only about telnet can connect to unix socket.

So can cat...  Actually, so can nc if you read the man page (which, of =
course, you did before deciding that it couldn't do what you needed).  =
With -U, it will connect to a UNIX domain socket.  Oh, and it can also =
create UNIX sockets for listening to:

$ nc -l -U tmp=20
$ # in another terminal:
$ nc -U tmp

And now you have two nc instances talking to each other via a UNIX =
socket.



> Why not? And why before this is will be ok?

Telnet is in the base system because, back in the 4BSD days, telnet was =
the recommended way that you logged into remote computers.  Now it =
isn't.  For most network diagnostic and simple socket operations, nc is =
a far more useful tool.  Including things that want to talk to UNIX =
sockets.

David




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?08E91A87-E3FA-47AE-ABDC-C23CA1A55B4C>