title: getting file size from the ls output
body: <p>I have a variable named <code>$lsoutput</code> in which I store the result of the <code>ls -l</code> command<br>
  It's content is </p>
  
  <ul>
  <li>-rw-r--r-- 1 root ftp 44 Apr 29 2003 <code>first_file.txt</code>  </li>
  <li>I would like to get the size of that file.  </li>
  <li>I useed the following regular expression</li>
  </ul>
  
  <hr>
  
  <pre><code>if [[ "$lsoutput" =~ ^[-rwx]{10}[[:space:]][[:digit:]]+[[:space:]][[:alnum:]]+[[:space:]][[:alnum:]]+[[:space]]([[:digit:]]+) ]]
      echo ${BASH_REMATCH[1]}
  fi
  </code></pre>
  
  <p>Unfortuantely this regexp does not work. What is wrong with it? Can you provide a correct one? Thanks for your help</p>