title: Shell - Subtracting an integer from a date
body: <p>I am trying to subtract an integer from a date. Basically I am trying to say that if it is the before the 15th of the month, so subtract 1 from the month. So if the day is 05-05-2016 I want to use 04 as the month.</p>
  
  <pre><code>Month=`date +%m`
  Day=`date +%d`
  
  If [ $Day -lt 15 ]
      then
          Output_Month=$Month - 1
  fi
  </code></pre>
  
  <p>This does not seem to be working because I assume they are in two different formats (date and integer). How can I either subtract a month or convert the month into an integer?</p>