title: TCP client in bash
body: <p>I have a TCP server written in python and clients in bash. </p>
  
  <p>Client sends data like this</p>
  
  <pre><code>cat file &gt; /dev/tcp/ip/port
  </code></pre>
  
  <p>and python server sends the response</p>
  
  <pre><code>clientsocket.send('some response')
  </code></pre>
  
  <p>I can send my data to server, it works fine but when server tries to send response my bash script blocks itself. I tried to use descriptors like below:</p>
  
  <pre><code>exec 3&lt;&gt;/dev/tcp/ip/port
  cat file &gt;&amp;3
  
  RESPOND=`cat &lt;&amp;3`
  echo $RESPOND
  </code></pre>
  
  <p>but it does not work (blocks itself)</p>
  
  <p>Thanks in advance</p>