title: How to send only one UDP packet with netcat?
body: <p>I want to send only one short value in a UDP packet, but running the command</p>
  
  <pre><code>echo -n "hello" | nc -4u localhost 8000
  </code></pre>
  
  <p>I can see that the server is getting the <em>hello</em> stuff but I have to press <kbd>Ctrl</kbd>+<kbd>c</kbd> to quit the netcat command. </p>
  
  <p>How can I make it quit after sending <em>hello</em>?</p>
  
  <hr>
  
  <p>Sorry, for the noise, I re-read the man page and found the <code>-q</code> option.</p>
  
  <pre><code> echo -n "hello" | nc -4u -q1 localhost 8000
  </code></pre>
  
  <p>works (it quits after 1 second).</p>
  
  <p>For some reason it does not work with <code>-q0</code>.</p>