title: tail | grep -q always returning true
body: <p>When I execute this code, the loop always ends at first time (even when the last two lines of <code>auth.log</code> doen't contain "exit"), which means that <code>$c</code> always gets some string:</p>
  
  <pre><code>while true;
  do
      c=$(tail -2 /var/log/auth.log | grep -q "exit")
      if $c ;
      then
              echo "true"
              unset c
              break
      fi
  </code></pre>
  
  <p>done</p>
  
  <p>Do you know why <code>c=$(tail -2 /var/log/auth.log | grep -q "exit")</code> is always getting some kind of string? I think it is becaues of <code>tail</code>.</p>
  
  <p>I can use the <code>-o</code> option and then compare strings, but I prefer to use a boolean inside the <code>if</code> condition.</p>