title: Pure bash cutting strings
body: <p>This is the size of a directory</p>
  
  <pre><code>casper@casperbox$ du -sh /home/casper/
  28G     /home/casper
  </code></pre>
  
  <p>I have a script that checks the size of the directory. </p>
  
  <pre><code>#!/bin/bash
  SIZEOFdir="/home/casper/"
  humanReadSizeonly=$(du -sh $SIZEOFdir | awk '{print $1}')
  </code></pre>
  
  <p>Instead of using awk in this context, as I always do, what is the pure bash non awk way of getting just the 28G ? And I don't want to use cut. There is some bash function in bash, and I really don't know what its name is. </p>
  
  <p>I use this to get rid of .sh or .pl from filenames. </p>
  
  <pre><code>${var%.*} 
  </code></pre>
  
  <p>I just do not know what the method is called. </p>