From: "\"Nils O. Selåsdal\"" <noselasd@asgaard.homelinux.org>
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?
Date: Tue, 4 Apr 2006 21:34:56 +0200 [thread overview]
Message-ID: <4432CA60.6010009@asgaard.homelinux.org> (raw)
In-Reply-To: <4432C4EA.10204@gmail.com>
Lluís Batlle i Rossell wrote:
> I hope this will not be any flame... but I hardly can believe that in a
> normal linux/bsd distribution there isn't any tool for redirecting
> stdin/stdout to a (new) tcp/udp connection. I think that
> file-descriptor-fans will know something like that...
>
> The most similar program I found is 'netcat', but in all the versions
> I've seen, it makes SO_LINGER with linger active, with a 0 seconds
> timeout, making it unusable for a "close() after input EOT"-behaviour.
> Moreover, netcat isn't a default as "ls" or "cat".
>
> Am I missing something? Which is the program I'm expecting to find for
> that redirection?
>
> Thanks in advance!
#!/bin/rc
port=''
host=''
proto='tcp'
switch($#*) {
case 2
host=$1 ; port=$2
case 3
host=$1 ; port=$2 ; proto=$3
case *
echo 'usage: nc ipaddr port [proto=tcp]'
exit usage
}
{
id=`{read <[0=3]}
echo $proto connection is $id
echo connect $host^'!'^$port >[1=3]
cat /net/$proto/$id/data &
cat >/net/$proto/$id/data
}<>[3] /net/$proto/clone
Though I'd like to see some improvements on that :-|
next prev parent reply other threads:[~2006-04-04 19:34 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-04 19:11 Lluís Batlle i Rossell
2006-04-04 19:34 ` "Nils O. Selåsdal" [this message]
2006-04-04 19:43 ` Paul Hebble
2006-04-04 20:36 ` Lluís Batlle i Rossell
2006-04-05 0:36 ` matt
2006-04-04 20:44 ` David Leimbach
2006-04-04 20:53 ` uriel
2006-04-04 21:20 ` Lluís Batlle i Rossell
2006-04-04 22:10 ` Bruce Ellis
2006-04-05 2:32 ` David Leimbach
2006-04-05 16:54 ` Aharon Robbins
2006-04-04 23:46 ` geoff
2006-04-05 1:05 ` Anthony Sorace
2006-04-05 2:21 ` Ronald G Minnich
2006-04-05 2:35 ` David Leimbach
2006-04-05 2:39 ` geoff
2006-04-05 2:45 ` David Leimbach
2006-04-05 2:50 ` geoff
2006-04-05 4:38 ` [9fans] netcat, Skip Tavakkolian
2006-04-05 4:41 ` geoff
2006-04-05 4:54 ` Skip Tavakkolian
2006-04-05 4:46 ` Bruce Ellis
2006-04-05 6:02 ` Adrian Tritschler
2006-04-05 15:50 ` Jack Johnson
2006-04-05 16:55 ` David Leimbach
2006-04-05 2:44 ` [9fans] netcat, the only stdin/stdout redirector to tcp/udp conns? Ronald G Minnich
2006-04-05 4:38 ` Bruce Ellis
2006-04-05 4:56 ` Skip Tavakkolian
2006-04-04 20:17 ` Russ Cox
2006-04-04 20:41 ` Lluís Batlle i Rossell
2006-04-04 22:45 ` Harri Haataja
2006-04-04 23:33 ` Taj Khattra
2006-04-05 10:34 ` Heiko Dudzus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4432CA60.6010009@asgaard.homelinux.org \
--to=noselasd@asgaard.homelinux.org \
--cc=9fans@cse.psu.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).