title: 'tail -f' doesn't give single lines when piped through grep'
body: <p>I am launching a website, and I wanted to setup a Bash one-liner so when someone hits the site it would make a beep using the internal buzzer.</p>
  
  <p>So far it's working using the following.</p>
  
  <pre><code>tail -f access_log | while read x ; do echo -ne '\007' $x '\n' ; done
  </code></pre>
  
  <p>Tail follows the access_log and dumps to STDOUT, get STDOUT line at a time, echo the line with '\007' "internal beep hex code", and done...</p>
  
  <p>This works like a beauty... Every hit shows the line from the log and beeps... However, it got annoying very quickly, so ideally I wanted to filter the <code>tail -f /access/log</code> before it's piped into the <code>while</code> so that read only gets lines I care about. I was thinking <code>grep "/index.php"</code> would be a good indication of visitors...</p>
  
  <p>This is where the issue is...</p>
  
  <p>I can do...</p>
  
  <pre><code>tail -f access_log | while read x ; do echo -ne '\007' $x '\n' ; done
  </code></pre>
  
  <p>beeps on everything
  and i can do...</p>
  
  <pre><code>tail -f access_log | grep "/index.php"
  </code></pre>
  
  <p>and pages are shown with no beep, but when i do</p>
  
  <pre><code>tail -f access_log | grep "/index.php" | while read x ; do echo -ne '\007' $x '\n' ; done
  </code></pre>
  
  <p>Nothing happens, no line from log, no beep.</p>
  
  <p>I think the grep is messing it up somewhere, but I can't figure out where.
  I'd love it to be a one liner, and I know it should really be done in a script and would be easier, but it doesn't explain why the above, which I think should work, isn't.</p>