netcat does not produce output when feeding via pipe

Bug #653304 reported by Felix Dietze
This bug report is a duplicate of:  Bug #544935: netcat-openbsd exits too soon. Edit Remove
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
netcat-openbsd (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Binary package hint: netcat

I am on the Maverick beta amd64, latest updates.

When I pipe content into netcat, it doesn't give me any output. Entering the commands manually works fine.

felix@felix-laptop:~/Desktop$ echo "GET / HTTP/1.0\n\n" | nc -v ubuntu.com 80
Connection to ubuntu.com 80 port [tcp/www] succeeded!
felix@felix-laptop:~/Desktop$ nc -v ubuntu.com 80
Connection to ubuntu.com 80 port [tcp/www] succeeded!
GET /
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="http://www.ubuntu.com/">here</a>.</p>
<hr>
<address>Apache/2.2.8 (Ubuntu) mod_python/3.3.1 Python/2.5.2 mod_ssl/2.2.8 OpenSSL/0.9.8g Server at vostok.canonical.com Port 80</address>
</body></html>
felix@felix-laptop:~/Desktop$

affects: netcat (Ubuntu) → netcat-openbsd (Ubuntu)
Revision history for this message
Scott Moser (smoser) wrote :

This is a duplicate of bug 544935.
The short answer is to do:
echo "GET / HTTP/1.0\n\n" | nc -v ubuntu.com 80 -q -1

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in netcat-openbsd (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.