title: Named pipe stops working
body: <p>I have two shell scipts: carrier.sh and pie.sh and two named pipes: Answer and Query in a folder.
  carrier.sh:</p>
  
  <pre><code>while read a
  do
  if [ "$a" = 'exit' ] ; then exit 0
  fi
  echo $a
  #echo $a &gt;&gt; troll.txt
  done
  </code></pre>
  
  <p>pie.sh:</p>
  
  <pre><code>( ./carrier.sh &gt; Answer ) &lt; Query &amp;
  echo 'Foo' &gt; Query
  read x &lt; Answer
  echo $x
  echo 'Boo' &gt; Query
  read x &lt; Answer
  echo $x
  echo 'exit' &gt; Query
  </code></pre>
  
  <p>Let's try: </p>
  
  <pre><code>$ ./pie.sh
  Foo
  
  ...
  </code></pre>
  
  <p>&lt;-And it waits here for typing instead of printing Boo and closing with new prompt. When I add the commented line it works ok. Why is that? I think it may be due to blocking, buffering or non-flushing in pipes. My original intention was communication with mysql-server from a shell script just in one session (and there's the same problem) but for it I could get answers like "use php" :p. What could I change in my code just only in pie.sh?</p>