title: Concurrent UART Output with Line Buffered
body: <p>I have 4 UART devices and I want to watch their output concurrently. I use the following script to do this job:</p>
  
  <pre><code># first kill the cat process from last run
  killall -v cat
  
  for i in `seq 0 3`; do
      cat /dev/crbif0rb0c$(i}ttyS0 | grep . --line-buffered &amp;
      # cat /dev/crbif0rb0c$(i)ttyS0 &amp;
  done
  </code></pre>
  
  <p>But I get no output from this script, except many empty lines. When I remove the <code>grep</code> stuff and use the second line in the for loop, I get a lot of outputs, but not readable since all outputs are messed up.</p>
  
  <p>So my question is <strong>why there is no output (except empty lines) when I use grep</strong>? Or anyone can provide a better (and workable) solutions for my scenario?</p>
  
  <p>Thanks in advance!</p>
  
  <p><strong>[UPDATE]</strong> I suddenly found that <code>cat /dev/crbif0rb0c${i}ttyS0 | grep ^ --line-buffered &amp;</code> will work. Don't know why... </p>