title: Subtracting strings (that are numbers) in a shell script
body: <p>I made a shell script that finds the size of a directory, returning it in human readable format (e.g., 802M or 702K). I want to calculate the difference between the sizes.</p>
  
  <p>Here's my shell script so far:</p>
  
  <pre><code>#!/bin/bash
  
  current_remote_dir_size=789M
  new_remote_dir_size=802M
  new_size=`echo ${new_remote_dir_size} | grep -o [0-9]*`
  current_size=`echo ${current_remote_dir_size} | grep -o [0-9]*`
  
  echo "${new_size}-${current_size}"
  </code></pre>
  
  <p>But the output of the script is just</p>
  
  <pre><code>-
  </code></pre>
  
  <p>How can I make the subtraction work?</p>