title: Bash: How to trim whitespace before using cut
body: <p>I have a line of output from a command like this:</p>
  
  <pre><code>[]$ &lt;command&gt; | grep "Memory Limit"
  Memory Limit:           12345 KB
  </code></pre>
  
  <p>I'm trying to pull out the 12345. The first step - separating by the colon - works fine</p>
  
  <pre><code>[]$ &lt;command&gt; | grep "Memory Limit" | cut -d ':' -f2
             12345 KB
  </code></pre>
  
  <p>Trying to separate this is what's tricky. How can I trim the whitespace so that <code>cut -d ' ' -f1</code> returns "12345" rather than a blank?</p>