title: Struggling to parse (bash) time command
body: <p>I'm struggling to parse the output of the time command in bash - and even to stop it from printing out its output when I call it. This is my test code:</p>
  
  <pre><code>#!/bin/bash
  TIME=`time ls -lh &gt; /dev/null`
  echo "Testing..."
  echo $TIME
  </code></pre>
  
  <p>This currently prints out:</p>
  
  <pre><code>{blank-line}
  real    0m0.064s
  user    0m0.002s
  sys     0m0.005s
  Testing
  {blank-line}
  </code></pre>
  
  <p>So, it seems like the value assigned to <code>$TIME</code> is the blank line at the start of the time print-out. I need to get at the seconds value of the sys line - that is, the "0.005". I am guaranteed that I will only ever have seconds, so I do not need anything before the "m" - however, the seconds part may be in the form of xx.xxx if it goes >= 10 seconds. I currently have no idea how to suppress the 'time' output, capture it all instead of the blank line, nor parse it to get the values I need.</p>
  
  <p>Any help would be much appreciated...</p>