title: bash date environment variable
body: <p>I need to calculate a date using a date string, derived from command line variables in a bash script.</p>
  
  <p>Assume I have a set of command line arguments (CLA's) such as $1=2013 $2=03 $3=22 and I want to get the formatted date string for a date before, or afterward by some number of days.</p>
  
  <p>I can always do, without the CLAs, </p>
  
  <pre><code>    date -d "20130322 -1 day" -u +%Y%m%d
  </code></pre>
  
  <p>but when I try something like,</p>
  
  <pre><code>    yyyy=2013
      month=03
      day=22
      yest='"'$yyyy$month$day'" -1 day"'
      yesterday=$(date -d $yest -u +%Y%m%d)
  </code></pre>
  
  <p>I get "date: invalid option -- '1'"</p>
  
  <p>Where have I gone wrong?</p>