Subject: Re: Proposal for new utility in base: bin/nc
To: None <>
From: Greg A. Woods <>
List: tech-userlevel
Date: 10/12/2001 17:35:49
[ On Friday, October 12, 2001 at 15:13:45 (-0500), Eric Gillespie, Jr. wrote: ]
> Subject: Re: Proposal for new utility in base: bin/nc
> I'm not sure what you mean.

What I meant by "line mode" is of course that I want to be able to type
a full line of input, using termios(4) input processing if I have it
enabled, and then have 'nc' see chunks of input terminated by a newline.

>  I use nc to talk SMTP and HTTP all
> the time.  I type into it just like i would cat.

Sorry, it does indeed work just fine.  I chose one of my currently
half-broken test servers to try as an example and unfortunately I forgot
it wasn't reading SMTP commands properly at the time.  :-(
My apologies for the false alarm!

However there is still the sometimes necessary feature related to
termios(4) handling, which is the need for an equivalent to the "stty
onlcr" option on the network side so that input newlines, which 'nc'
sees at the end of my typed lines after I type <CR>, can (optionally) be
sent to the server as <CR><NL> (thus making it more telnet-like).

Another feature that's sometimes needed for scripting things like SMTP
or HTTP is a way to hold the connection open even after stdin has run
into EOF.  I.e. (optionally) don't stop reading from the network just
because there's no more input on stdin.  This is one of the biggest
problems with using most telnet clients in scripts....

> I agree, though i'm not surprised by the resistance.

I think some folks might not realize that 'nc' is the more correct tool
to use everywhere they might currently be using 'telnet'.  Telnet is
sometimes a really poor choice of tool to use to connect to anything
other than a telnet server daemon.  Besides being greatly bloated,
telnet can potentially cause unexpected behaviour when the remote server
might trigger an attempt to negotiate the TELNET protocol (though this
is very rare in my experience).

							Greg A. Woods

+1 416 218-0098      VE3TCP      <>     <>
Planix, Inc. <>;   Secrets of the Weird <>