title: Using grep for listing files by owner/read perms
body: <p>The rest of my bash script works, just having trouble using grep. On each file I am using the following command:</p>
  <pre><code>ls -l $filepath | grep &quot;^.r..r..r.*${2}$&quot;
  </code></pre>
  <p>How can I properly use the second argument in the regular expression? What I am trying to do is print the file if it can be read by anyone and the owner is who is passed by the second argument.</p>
  <p>Using:</p>
  <pre><code>ls -l $filepath | grep &quot;^.r..r..r&quot;
  </code></pre>
  <p>Will print the information successfully based on the read permissions. What I am trying to do is print based on... [read permission][any characters in between][ending with the owner's name]</p>