9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] netcat, the only stdin/stdout redirector to tcp/udp conns?
@ 2006-04-04 19:11 Lluís Batlle i Rossell
  2006-04-04 19:34 ` "Nils O. Selåsdal"
                   ` (4 more replies)
  0 siblings, 5 replies; 33+ messages in thread
From: Lluís Batlle i Rossell @ 2006-04-04 19:11 UTC (permalink / raw)
  To: 9fans Mailing list

[-- Attachment #1: Type: text/plain, Size: 634 bytes --]

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!

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/x-pkcs7-signature, Size: 3311 bytes --]

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [9fans] netcat, the only stdin/stdout redirector to tcp/udp conns?
  2006-04-04 19:11 [9fans] netcat, the only stdin/stdout redirector to tcp/udp conns? Lluís Batlle i Rossell
@ 2006-04-04 19:34 ` "Nils O. Selåsdal"
  2006-04-04 19:43   ` Paul Hebble
  2006-04-04 20:17 ` Russ Cox
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 33+ messages in thread
From: "Nils O. Selåsdal" @ 2006-04-04 19:34 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

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 :-|



^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [9fans] netcat, the only stdin/stdout redirector to tcp/udp conns?
  2006-04-04 19:34 ` "Nils O. Selåsdal"
@ 2006-04-04 19:43   ` Paul Hebble
  2006-04-04 20:36     ` Lluís Batlle i Rossell
                       ` (3 more replies)
  0 siblings, 4 replies; 33+ messages in thread
From: Paul Hebble @ 2006-04-04 19:43 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On Tue, Apr 04, 2006 at 09:34:56PM +0200, "Nils O. Selåsdal" wrote:
> Lluís 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ís's email, so I had to
 wait for another reply to get on the thread.)

-- 
	Paul


^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [9fans] netcat, the only stdin/stdout redirector to tcp/udp conns?
  2006-04-04 19:11 [9fans] netcat, the only stdin/stdout redirector to tcp/udp conns? Lluís Batlle i Rossell
  2006-04-04 19:34 ` "Nils O. Selåsdal"
@ 2006-04-04 20:17 ` Russ Cox
  2006-04-04 20:41   ` Lluís Batlle i Rossell
  2006-04-04 22:45 ` Harri Haataja
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 33+ messages in thread
From: Russ Cox @ 2006-04-04 20:17 UTC (permalink / raw)
  To: 9fans

> 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...

we could go on for days listing completions of

    I hardly can believe that in a normal linux bsd distribution _____.

welcome to modern unix.

> 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?

i believe you are expecting to find plan9port's dial(1).

russ



^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [9fans] netcat, the only stdin/stdout redirector to tcp/udp conns?
  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
                       ` (2 subsequent siblings)
  3 siblings, 1 reply; 33+ messages in thread
From: Lluís Batlle i Rossell @ 2006-04-04 20:36 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 136 bytes --]

Paul Hebble wrote:
>It's always the one you least expect: (bash)
Impressive... In fact I already thought using those gawk sockets :)

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/x-pkcs7-signature, Size: 3311 bytes --]

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [9fans] netcat, the only stdin/stdout redirector to tcp/udp conns?
  2006-04-04 20:17 ` Russ Cox
@ 2006-04-04 20:41   ` Lluís Batlle i Rossell
  0 siblings, 0 replies; 33+ messages in thread
From: Lluís Batlle i Rossell @ 2006-04-04 20:41 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 344 bytes --]

Russ Cox wrote:
> we could go on for days listing completions of
>
>     I hardly can believe that in a normal linux bsd distribution _____.
>
> welcome to modern unix.
I was afraid of that, yes.
> i believe you are expecting to find plan9port's dial(1).
Thanks! Maybe that simple sentence was more useful to me than you
expected. :)

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/x-pkcs7-signature, Size: 3311 bytes --]

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [9fans] netcat, the only stdin/stdout redirector to tcp/udp conns?
  2006-04-04 19:43   ` Paul Hebble
  2006-04-04 20:36     ` Lluís Batlle i Rossell
@ 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-05  1:05     ` Anthony Sorace
  3 siblings, 1 reply; 33+ messages in thread
From: David Leimbach @ 2006-04-04 20:44 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On 4/4/06, Paul Hebble <maceo@imsa.edu> wrote:
> On Tue, Apr 04, 2006 at 09:34:56PM +0200, "Nils O. Selåsdal" wrote:
> > Lluís 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ís'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
>


^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [9fans] netcat, the only stdin/stdout redirector to tcp/udp conns?
  2006-04-04 20:44     ` David Leimbach
@ 2006-04-04 20:53       ` uriel
  0 siblings, 0 replies; 33+ messages in thread
From: uriel @ 2006-04-04 20:53 UTC (permalink / raw)
  To: 9fans

> 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.

Gosh, we are so behind the times! someone, fast, add this feature to rc!

uriel



^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [9fans] netcat, the only stdin/stdout redirector to tcp/udp conns?
  2006-04-04 19:43   ` Paul Hebble
  2006-04-04 20:36     ` Lluís Batlle i Rossell
  2006-04-04 20:44     ` David Leimbach
@ 2006-04-04 21:20     ` Lluís Batlle i Rossell
  2006-04-04 22:10       ` Bruce Ellis
  2006-04-04 23:46       ` geoff
  2006-04-05  1:05     ` Anthony Sorace
  3 siblings, 2 replies; 33+ messages in thread
From: Lluís Batlle i Rossell @ 2006-04-04 21:20 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 844 bytes --]

Paul Hebble wrote:
>               /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.
And any other proposal for a listen? I think 'gawk' won't work fine as a
listener, specially for binary files (I'd like not to uuencode/uudecode
the transmission, although it went through my head).
Thanks!

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/x-pkcs7-signature, Size: 3311 bytes --]

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [9fans] netcat, the only stdin/stdout redirector to tcp/udp conns?
  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
  1 sibling, 2 replies; 33+ messages in thread
From: Bruce Ellis @ 2006-04-04 22:10 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

bless bash.  that's a disgusting hack.

brucee

On 4/5/06, Lluís Batlle i Rossell <viriketo@gmail.com> wrote:
> Paul Hebble wrote:
> >               /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.
> And any other proposal for a listen? I think 'gawk' won't work fine as a
> listener, specially for binary files (I'd like not to uuencode/uudecode
> the transmission, although it went through my head).
> Thanks!
>
>
>


^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [9fans] netcat, the only stdin/stdout redirector to tcp/udp conns?
  2006-04-04 19:11 [9fans] netcat, the only stdin/stdout redirector to tcp/udp conns? Lluís Batlle i Rossell
  2006-04-04 19:34 ` "Nils O. Selåsdal"
  2006-04-04 20:17 ` Russ Cox
@ 2006-04-04 22:45 ` Harri Haataja
  2006-04-04 23:33 ` Taj Khattra
  2006-04-05 10:34 ` Heiko Dudzus
  4 siblings, 0 replies; 33+ messages in thread
From: Harri Haataja @ 2006-04-04 22:45 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On Tue, Apr 04, 2006 at 09:11:38PM +0200, 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...

Not sure if it's any different than netcat for you, but there's socat.

Description: multipurpose relay for bidirectional data transfer
 Socat (for SOcket CAT) establishes two bidirectional byte streams
 and transfers data between them. Data channels may be files, pipes,
 devices (terminal or modem, etc.), or sockets (Unix, IPv4, IPv6, raw,
 UDP, TCP, SSL). It provides forking, logging and tracing, different
 modes for interprocess communication and many more options.
 .
 It can be used, for example, as a TCP relay (one-shot or daemon),
 as an external socksifier, as a shell interface to Unix sockets,
 as an IPv6 relay, as a netcat and rinetd replacement, to redirect
 TCP-oriented programs to a serial line, or to establish a relatively
 secure environment (su and chroot) for running client or server shell
 scripts inside network connections.

Upstream would appear to be http://www.dest-unreach.org/socat/

-- 
My kettle just sits there steaming, and won't tell me anything.
Much like my first wife.
		-- Paul Tomblin


^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [9fans] netcat, the only stdin/stdout redirector to tcp/udp conns?
  2006-04-04 19:11 [9fans] netcat, the only stdin/stdout redirector to tcp/udp conns? Lluís Batlle i Rossell
                   ` (2 preceding siblings ...)
  2006-04-04 22:45 ` Harri Haataja
@ 2006-04-04 23:33 ` Taj Khattra
  2006-04-05 10:34 ` Heiko Dudzus
  4 siblings, 0 replies; 33+ messages in thread
From: Taj Khattra @ 2006-04-04 23:33 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> file-descriptor-fans will know something like that...

ipsvd?  http://smarden.sunsite.dk/ipsvd/


^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [9fans] netcat, the only stdin/stdout redirector to tcp/udp conns?
  2006-04-04 21:20     ` Lluís Batlle i Rossell
  2006-04-04 22:10       ` Bruce Ellis
@ 2006-04-04 23:46       ` geoff
  1 sibling, 0 replies; 33+ messages in thread
From: geoff @ 2006-04-04 23:46 UTC (permalink / raw)
  To: 9fans

I have a little unix program called listen.c, I think written by
Michael Baldwin.  If he wrote it and it's okay with him, I'm willing
to distribute it.  It's much like Plan 9's listen1.



^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [9fans] netcat, the only stdin/stdout redirector to tcp/udp conns?
  2006-04-04 20:36     ` Lluís Batlle i Rossell
@ 2006-04-05  0:36       ` matt
  0 siblings, 0 replies; 33+ messages in thread
From: matt @ 2006-04-05  0:36 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

I use tcpserver as a listener

accepts connections and execs itself with stdin/stdout on the port

http://cr.yp.to/ucspi-tcp.html


tcpclient is a client but uses fd 6 &7 as stdin/stdout




^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [9fans] netcat, the only stdin/stdout redirector to tcp/udp conns?
  2006-04-04 19:43   ` Paul Hebble
                       ` (2 preceding siblings ...)
  2006-04-04 21:20     ` Lluís Batlle i Rossell
@ 2006-04-05  1:05     ` Anthony Sorace
  2006-04-05  2:21       ` Ronald G Minnich
  3 siblings, 1 reply; 33+ messages in thread
From: Anthony Sorace @ 2006-04-05  1:05 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On 4/4/06, Paul Hebble <maceo@imsa.edu> wrote:
> It's always the one you least expect:

*least* expect? at this point, i pretty much expect *everything* to be in bash.

^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [9fans] netcat, the only stdin/stdout redirector to tcp/udp conns?
  2006-04-05  1:05     ` Anthony Sorace
@ 2006-04-05  2:21       ` Ronald G Minnich
  2006-04-05  2:35         ` David Leimbach
  0 siblings, 1 reply; 33+ messages in thread
From: Ronald G Minnich @ 2006-04-05  2:21 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Anthony Sorace wrote:
> On 4/4/06, Paul Hebble <maceo@imsa.edu> wrote:
>
>>It's always the one you least expect:
>
>
> *least* expect? at this point, i pretty much expect *everything* to be in bash.

sure. if you type this:
make and then this:
make <tab>
bash will print the list of possible targets for makefile.

You gotta love it.

only on recent bash -- I saw it on gentoo.

ron


^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [9fans] netcat, the only stdin/stdout redirector to tcp/udp conns?
  2006-04-04 22:10       ` Bruce Ellis
@ 2006-04-05  2:32         ` David Leimbach
  2006-04-05 16:54         ` Aharon Robbins
  1 sibling, 0 replies; 33+ messages in thread
From: David Leimbach @ 2006-04-05  2:32 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Yep... layering violations abound.

zsh is a lot cleaner about it, doesn't pretend to be part of the
filesystem.  But then again, netcat already did most of this job so
*shrug*.

Dave

On 4/4/06, Bruce Ellis <bruce.ellis@gmail.com> wrote:
> bless bash.  that's a disgusting hack.
>
> brucee
>
> On 4/5/06, Lluís Batlle i Rossell <viriketo@gmail.com> wrote:
> > Paul Hebble wrote:
> > >               /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.
> > And any other proposal for a listen? I think 'gawk' won't work fine as a
> > listener, specially for binary files (I'd like not to uuencode/uudecode
> > the transmission, although it went through my head).
> > Thanks!
> >
> >
> >
>


^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [9fans] netcat, the only stdin/stdout redirector to tcp/udp conns?
  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:44           ` [9fans] netcat, the only stdin/stdout redirector to tcp/udp conns? Ronald G Minnich
  0 siblings, 2 replies; 33+ messages in thread
From: David Leimbach @ 2006-04-05  2:35 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On 4/4/06, Ronald G Minnich <rminnich@lanl.gov> wrote:
> Anthony Sorace wrote:
> > On 4/4/06, Paul Hebble <maceo@imsa.edu> wrote:
> >
> >>It's always the one you least expect:
> >
> >
> > *least* expect? at this point, i pretty much expect *everything* to be in bash.
>
> sure. if you type this:
> make and then this:
> make <tab>
> bash will print the list of possible targets for makefile.
>
> You gotta love it.
>
> only on recent bash -- I saw it on gentoo.
>
> ron
>

PAH that's nothing... zsh can be configured to use ssh-agent to do
completion for "scp" on remote hosts.....

And no, I'm not kidding.

I believe recent bash does this too.

Dave


^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [9fans] netcat, the only stdin/stdout redirector to tcp/udp conns?
  2006-04-05  2:35         ` David Leimbach
@ 2006-04-05  2:39           ` geoff
  2006-04-05  2:45             ` David Leimbach
  2006-04-05  2:44           ` [9fans] netcat, the only stdin/stdout redirector to tcp/udp conns? Ronald G Minnich
  1 sibling, 1 reply; 33+ messages in thread
From: geoff @ 2006-04-05  2:39 UTC (permalink / raw)
  To: 9fans

> PAH that's nothing...  zsh can be configured to use ssh-agent to do
> completion for "scp" on remote hosts.....

It must take a long time to enumerate all the hosts on the Internet,
no?  Particularly since domain addresses are backward.



^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [9fans] netcat, the only stdin/stdout redirector to tcp/udp conns?
  2006-04-05  2:35         ` David Leimbach
  2006-04-05  2:39           ` geoff
@ 2006-04-05  2:44           ` Ronald G Minnich
  2006-04-05  4:38             ` Bruce Ellis
  2006-04-05  4:56             ` Skip Tavakkolian
  1 sibling, 2 replies; 33+ messages in thread
From: Ronald G Minnich @ 2006-04-05  2:44 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

David Leimbach wrote:

> PAH that's nothing... zsh can be configured to use ssh-agent to do
> completion for "scp" on remote hosts.....
>
> And no, I'm not kidding.
>
> I believe recent bash does this too.


Thanks for that. I just ate.

btw, for some fun, see the videos at despair.com/spin

ron


^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [9fans] netcat, the only stdin/stdout redirector to tcp/udp conns?
  2006-04-05  2:39           ` geoff
@ 2006-04-05  2:45             ` David Leimbach
  2006-04-05  2:50               ` geoff
  0 siblings, 1 reply; 33+ messages in thread
From: David Leimbach @ 2006-04-05  2:45 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On 4/4/06, geoff@collyer.net <geoff@collyer.net> wrote:
> > PAH that's nothing...  zsh can be configured to use ssh-agent to do
> > completion for "scp" on remote hosts.....
>
> It must take a long time to enumerate all the hosts on the Internet,
> no?  Particularly since domain addresses are backward.
>
>

Example:

scp user@hostname:~/<TAB>

It connects and completes.


^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [9fans] netcat, the only stdin/stdout redirector to tcp/udp conns?
  2006-04-05  2:45             ` David Leimbach
@ 2006-04-05  2:50               ` geoff
  2006-04-05  4:38                 ` [9fans] netcat, Skip Tavakkolian
  0 siblings, 1 reply; 33+ messages in thread
From: geoff @ 2006-04-05  2:50 UTC (permalink / raw)
  To: 9fans

I was making a weak joke.  Once you've typed

	scp user@h

a naive completion algorithm would be:
- enumerate all hosts on the internet;
- eliminate those that don't start with `h';
- display the (massive list) of potential hostnames.

At least if domain names were big-endian (edu.psu.cse), like file
names, once someone had typed

	scp user@com.

completion could avoid searching the net, org, mil, gov, us, ca, etc.
domains.



^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [9fans] netcat,
  2006-04-05  2:50               ` geoff
@ 2006-04-05  4:38                 ` Skip Tavakkolian
  2006-04-05  4:41                   ` geoff
                                     ` (3 more replies)
  0 siblings, 4 replies; 33+ messages in thread
From: Skip Tavakkolian @ 2006-04-05  4:38 UTC (permalink / raw)
  To: 9fans

> I was making a weak joke.  Once you've typed
>
> 	scp user@h
>
> a naive completion algorithm would be:
> - enumerate all hosts on the internet;
> - eliminate those that don't start with `h';
> - display the (massive list) of potential hostnames.
>
> At least if domain names were big-endian (edu.psu.cse), like file
> names, once someone had typed
>
> 	scp user@com.
>
> completion could avoid searching the net, org, mil, gov, us, ca, etc.
> domains.

I'm taking bets that this will be implemented sometime over
the next year.



^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [9fans] netcat, the only stdin/stdout redirector to tcp/udp conns?
  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
  1 sibling, 0 replies; 33+ messages in thread
From: Bruce Ellis @ 2006-04-05  4:38 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

i must reiterate.  vomituous (as dhog would say).

brucee

On 4/5/06, Ronald G Minnich <rminnich@lanl.gov> wrote:
> David Leimbach wrote:
>
> > PAH that's nothing... zsh can be configured to use ssh-agent to do
> > completion for "scp" on remote hosts.....
> >
> > And no, I'm not kidding.
> >
> > I believe recent bash does this too.
>
>
> Thanks for that. I just ate.
>
> btw, for some fun, see the videos at despair.com/spin
>
> ron
>


^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [9fans] netcat,
  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
                                     ` (2 subsequent siblings)
  3 siblings, 1 reply; 33+ messages in thread
From: geoff @ 2006-04-05  4:41 UTC (permalink / raw)
  To: 9fans

> I'm taking bets that this will be implemented sometime over the next
> year.

What's `this'?  Big-endian domain names or internet-wide  completion?



^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [9fans] netcat,
  2006-04-05  4:38                 ` [9fans] netcat, Skip Tavakkolian
  2006-04-05  4:41                   ` geoff
@ 2006-04-05  4:46                   ` Bruce Ellis
  2006-04-05  6:02                   ` Adrian Tritschler
  2006-04-05 15:50                   ` Jack Johnson
  3 siblings, 0 replies; 33+ messages in thread
From: Bruce Ellis @ 2006-04-05  4:46 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

there will be someone duped into attempting it ... open doesn't work.

brucee

On 4/5/06, Skip Tavakkolian <9nut@9netics.com> wrote:
> > I was making a weak joke.  Once you've typed
> >
> >       scp user@h
> >
> > a naive completion algorithm would be:
> > - enumerate all hosts on the internet;
> > - eliminate those that don't start with `h';
> > - display the (massive list) of potential hostnames.
> >
> > At least if domain names were big-endian (edu.psu.cse), like file
> > names, once someone had typed
> >
> >       scp user@com.
> >
> > completion could avoid searching the net, org, mil, gov, us, ca, etc.
> > domains.
>
> I'm taking bets that this will be implemented sometime over
> the next year.
>
>


^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [9fans] netcat,
  2006-04-05  4:41                   ` geoff
@ 2006-04-05  4:54                     ` Skip Tavakkolian
  0 siblings, 0 replies; 33+ messages in thread
From: Skip Tavakkolian @ 2006-04-05  4:54 UTC (permalink / raw)
  To: 9fans

>> I'm taking bets that this will be implemented sometime over the next
>> year.
>
> What's `this'?  Big-endian domain names or internet-wide  completion?

internet wide completion.

ok, now i'm taking bets that somebody would implement wget url
completion - if it has not been done already.



^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [9fans] netcat, the only stdin/stdout redirector to tcp/udp conns?
  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
  1 sibling, 0 replies; 33+ messages in thread
From: Skip Tavakkolian @ 2006-04-05  4:56 UTC (permalink / raw)
  To: 9fans

> btw, for some fun, see the videos at despair.com/spin

one of my favorites:

http://www.despair.com/limitations.html



^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [9fans] netcat,
  2006-04-05  4:38                 ` [9fans] netcat, Skip Tavakkolian
  2006-04-05  4:41                   ` geoff
  2006-04-05  4:46                   ` Bruce Ellis
@ 2006-04-05  6:02                   ` Adrian Tritschler
  2006-04-05 15:50                   ` Jack Johnson
  3 siblings, 0 replies; 33+ messages in thread
From: Adrian Tritschler @ 2006-04-05  6:02 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Skip Tavakkolian wrote:
>>I was making a weak joke.  Once you've typed
>>
>>	scp user@h
>>
>>a naive completion algorithm would be:
>>- enumerate all hosts on the internet;
>>- eliminate those that don't start with `h';
>>- display the (massive list) of potential hostnames.
>>
>>At least if domain names were big-endian (edu.psu.cse), like file
>>names, once someone had typed
>>
>>	scp user@com.
>>
>>completion could avoid searching the net, org, mil, gov, us, ca, etc.
>>domains.
> 
> 
> I'm taking bets that this will be implemented sometime over
> the next year.

Maybe it was implemented last year, but everyone who has tried to use it
is still buffering the output...

---------------------------------------------------------------
Adrian Tritschler                          mailto:ajft@ajft.org
Latitude 38°S, Longitude 145°E, Altitude 50m,      Shoe size 44
---------------------------------------------------------------


^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [9fans] netcat, the only stdin/stdout redirector to tcp/udp conns?
  2006-04-04 19:11 [9fans] netcat, the only stdin/stdout redirector to tcp/udp conns? Lluís Batlle i Rossell
                   ` (3 preceding siblings ...)
  2006-04-04 23:33 ` Taj Khattra
@ 2006-04-05 10:34 ` Heiko Dudzus
  4 siblings, 0 replies; 33+ messages in thread
From: Heiko Dudzus @ 2006-04-05 10:34 UTC (permalink / raw)
  To: 9fans

> 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. [...]
> 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".

I prefer 'netpipes' for that reason, (although uglier to call).

http://web.purplefrog.com/~/thoth/netpipes/netpipes.html

Heiko

P.S.: I see p9p builds without problems on NetBSD nowadays, so I'll
give dial a try.



^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [9fans] netcat,
  2006-04-05  4:38                 ` [9fans] netcat, Skip Tavakkolian
                                     ` (2 preceding siblings ...)
  2006-04-05  6:02                   ` Adrian Tritschler
@ 2006-04-05 15:50                   ` Jack Johnson
  2006-04-05 16:55                     ` David Leimbach
  3 siblings, 1 reply; 33+ messages in thread
From: Jack Johnson @ 2006-04-05 15:50 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On 4/4/06, Skip Tavakkolian <9nut@9netics.com> wrote:
> > I was making a weak joke.  Once you've typed

The better joke would have been that it already works.

With bash, if you 'scp user@host:/et<TAB>' it will autocomplete from
the local filesystem.  A groggy user might take your joke, try it, and
think they're seeing the filesystem at the far end.

I did read a decent interview with Sir Tim recently (though apparently
I didn't bookmark it), where he says he realizes he botched URLs (and
now regrets it) by not starting with the TLD and working down.

-Jack


^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [9fans] netcat, the only stdin/stdout redirector to tcp/udp conns?
  2006-04-04 22:10       ` Bruce Ellis
  2006-04-05  2:32         ` David Leimbach
@ 2006-04-05 16:54         ` Aharon Robbins
  1 sibling, 0 replies; 33+ messages in thread
From: Aharon Robbins @ 2006-04-05 16:54 UTC (permalink / raw)
  To: 9fans

Actually, this was done first in the Korn shell. (Surprise, surprise.)

Arnold

In article <775b8d190604041510h368f22aen31067a6e7333c8cc@mail.gmail.com> you write:
>bless bash.  that's a disgusting hack.
>
>brucee
>
>On 4/5/06, Lluםs Batlle i Rossell <viriketo@gmail.com> wrote:
>> Paul Hebble wrote:
>> >               /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.
>> And any other proposal for a listen? I think 'gawk' won't work fine as a
>> listener, specially for binary files (I'd like not to uuencode/uudecode
>> the transmission, although it went through my head).
>> Thanks!
-- 
Aharon (Arnold) Robbins --- Pioneer Consulting Ltd.	arnold AT skeeve DOT com
P.O. Box 354		Home Phone: +972  8 979-0381	Fax: +1 206 350 8765
Nof Ayalon		Cell Phone: +972 50  729-7545
D.N. Shimshon 99785	ISRAEL


^ permalink raw reply	[flat|nested] 33+ messages in thread

* Re: [9fans] netcat,
  2006-04-05 15:50                   ` Jack Johnson
@ 2006-04-05 16:55                     ` David Leimbach
  0 siblings, 0 replies; 33+ messages in thread
From: David Leimbach @ 2006-04-05 16:55 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On 4/5/06, Jack Johnson <knapjack@gmail.com> wrote:
> On 4/4/06, Skip Tavakkolian <9nut@9netics.com> wrote:
> > > I was making a weak joke.  Once you've typed
>
> The better joke would have been that it already works.
>
> With bash, if you 'scp user@host:/et<TAB>' it will autocomplete from
> the local filesystem.  A groggy user might take your joke, try it, and
> think they're seeing the filesystem at the far end.
>

Bash can and does autocomplete remote filenames too.

See http://www.debian-administration.org/articles/130 (scroll down)

"Also, if you use ssh/scp a lot, bash_completion complete hosts and
remote filenames by default if you use ssh-agent:

scp local_file root@hTAB/remTAB/paTAB
would then expand as :
scp local_file root@host:/remote/path/

you'll need of course a fast and low-latency connection for it to be
useful. Waiting several seconds after typing TAB becomes annoying with
time ;)"



> I did read a decent interview with Sir Tim recently (though apparently
> I didn't bookmark it), where he says he realizes he botched URLs (and
> now regrets it) by not starting with the TLD and working down.
>
> -Jack
>


^ permalink raw reply	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2006-04-05 16:55 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-04 19:11 [9fans] netcat, the only stdin/stdout redirector to tcp/udp conns? Lluís Batlle i Rossell
2006-04-04 19:34 ` "Nils O. Selåsdal"
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

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).