Re: nc not working as advertised

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On 2013-03-07, Robert Moskowitz <rgm@xxxxxxxxxxxxxxx> wrote:
>
> On 03/07/2013 05:06 PM, Paul Heinlein wrote:
>> On Thu, 7 Mar 2013, Robert Moskowitz wrote:
>>
>>> I can't get nc to do anything worthwhile. In fact I can't even get the
>>> examples in the manpage to work.  From either my C6 servers or my F17
>>> notebooks.  For example:
>>>
>>> echo -n "GET / HTTP/1.0\r\n\r\n" | nc medon.htt-consult.com 80
>>
>> You mean
>>
>>   echo -ne "GET ..."
>>
>> right?
>
> No.  I did a simple copy from the manpage.  check it out yourself. :(

The man page may be incorrect.  You need -e in order to get echo to
print out the line feeds properly:

$ echo -ne "GET / HTTP/1.0\n\n" 
GET / HTTP/1.0

$ echo -n "GET / HTTP/1.0\n\n" 
GET / HTTP/1.0\n\n$ 

(I left the $ prompt in the output, to show that there's really no line
feed.)

Did you also try the client/server example in the man page (which looks
correct to me)?

--keith

-- 
kkeller@xxxxxxxxxxxxxxxxxxxxxxxxxx


_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos


[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux