title: ZSH/Shell variable assignment/usage
body: <p>I use ZSH for my terminal shell, and whilst I've written several functions to automate specific tasks, I've never really attempted anything that requires the functionality I'm after at the moment.</p>
  
  <p>I've recently re-written a blog using Jekyll and I want to automate the production of blog posts and finally the uploading of the newly produced files to my server using something like scp.</p>
  
  <p>I'm slightly confused about the variable bindings/usage in ZSH; for example:</p>
  
  <pre><code>DATE= date +'20%y-%m-%d'
  echo $DATE
  </code></pre>
  
  <p>correctly outputs 2011-08-23 as I'd expect.</p>
  
  <p>But when I try:</p>
  
  <pre><code>DATE= date +'20%y-%m-%d'
  FILE= "~/path/to/_posts/$DATE-$1.markdown"
  echo $FILE
  </code></pre>
  
  <p>It outputs:</p>
  
  <pre><code>2011-08-23
  blog.sh: line 4: ~/path/to/_posts/-.markdown: No such file or directory
  </code></pre>
  
  <p>And when run with what I'd be wanting the blog title to be (ignoring the fact the string needs to be manipulated to make it more url friendly and that the route path/to doesn't exist)</p>
  
  <p>i.e. blog "blog title", outputs:</p>
  
  <pre><code>2011-08-23
  blog.sh: line 4: ~/path/to/_posts/-blog title.markdown: No such file or directory
  </code></pre>
  
  <p>Why is $DATE printing above the call to print $FILE rather than the string being included in $FILE?</p>