title: Bash scripting - execute and grep command inside script
body: <p>Okay, so I'm learning Bash, and there's that exercise;</p>
  
  <p><em>"Write a script that checks every ten seconds if the user 'user000' is logged in."</em></p>
  
  <p>My idea is to <code>grep</code> a <code>who</code>, but I don't know how to incorporate this into a script. I tried things like</p>
  
  <pre><code>if [ `who | grep "user000"` ] then things
  </code></pre>
  
  <p>but it returns the matched lines with grep, not true/false.</p>