From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <3e1162e60604041344q77a43270kee40aa4a606b4afe@mail.gmail.com> Date: Tue, 4 Apr 2006 13:44:13 -0700 From: "David Leimbach" To: "Fans of the OS Plan 9 from Bell Labs" <9fans@cse.psu.edu> Subject: Re: [9fans] netcat, the only stdin/stdout redirector to tcp/udp conns? In-Reply-To: <20060404194312.GA11874@imsa.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <4432C4EA.10204@gmail.com> <4432CA60.6010009@asgaard.homelinux.org> <20060404194312.GA11874@imsa.edu> Topicbox-Message-UUID: 2ea04620-ead1-11e9-9d60-3106f5b1d025 On 4/4/06, Paul Hebble wrote: > On Tue, Apr 04, 2006 at 09:34:56PM +0200, "Nils O. Sel=E5sdal" wrote: > > Llu=EDs Batlle i Rossell wrote: > > >Am I missing something? Which is the program I'm expecting to find for > > >that redirection? > > It's always the one you least expect: > > Bash handles several filenames specially when they are > used in redirections, as described in the following table: > > /dev/tcp/host/port > If host is a valid hostname or Internet > address, and port is an integer port number > or service name, bash attempts to open a TCP > connection to the corresponding socket. > /dev/udp/host/port > If host is a valid hostname or Internet > address, and port is an integer port number > or service name, bash attempts to open a UDP > connection to the corresponding socket. > > (Sorry for the weird quoting, I already deleted Llu=EDs's email, so I had= to > wait for another reply to get on the thread.) > It's worth noting /dev/tcp is part of bash. zsh has it's own ways of doing the same stuff. netcat is *not* the only way to do this stuff on unix... it just appears to be the only shell-agnostic way. Dave > -- > Paul >