title: error while trying print to several files in bash scripts
body: <p>I've got a problem related to write to files.<br>
  I've created <code>server/client</code> in <code>c</code> (for <code>Linux</code>, via <code>sockets</code>).<br>
  I want the <code>clients</code> to save a log file with all the actions they did. When I open a client and transfer file everything is OK but when I check my server's multi requests support (by creating a bash script that checks it all) I discovered that none of my clients write anything.  </p>
  
  <p>Client command is: <code>./client_prog host port file_to_receive log_file</code></p>
  
  <p>Script:</p>
  
  <pre><code>cd client1/
  ./client_prog localhost 22222 file.txt log &amp;
  cd client2/
  ./client_prog localhost 22222 file.txt log &amp;
  cd client3/
  ./client_prog localhost 22222 file.txt log &amp;
  #more clients....
  </code></pre>
  
  <p>each client create log thread and with pipe transferring data, and the log thread write it with <code>fopen</code>(), <code>fprintf</code>() and <code>fclose</code>().</p>
  
  <p>BTW, when I try from two different terminals, it's working fine.<br>
  It doesn't make any sense..   </p>
  
  <p>Thanks!</p>