title: Write and read from a fifo from two different script
body: <p>I have two bash script. 
  One script write in a fifo. The second one read from the fifo, but AFTER the first one end to write.</p>
  
  <p>But something does not work. I do not understand where the problem is. Here the code.</p>
  
  <p>The first script is (the writer):</p>
  
  <pre><code>#!/bin/bash
  
  fifo_name="myfifo";
  
  # Se non esiste, crea la fifo;
  [ -p $fifo_name ] || mkfifo $fifo_name;
  
  exec 3&lt;&gt; $fifo_name;
  
  echo "foo" &gt; $fifo_name;
  echo "bar" &gt; $fifo_name;
  </code></pre>
  
  <p>The second script is (the reader):</p>
  
  <pre><code>#!/bin/bash
  
  fifo_name="myfifo";
  
  while true
  do
      if read line &lt;$fifo_name; then
         # if [[ "$line" == 'ar' ]]; then
          #    break
          #fi
          echo $line
      fi
  done
  </code></pre>
  
  <p>Can anyone help me please?
  Thank you</p>