title: Quotes within Bash Shell variable do not work, why?
body: <pre><code>#!/bin/sh
  LOG='log --pretty=format:"%h - %an, %ar : %s"'
  
  git $LOG
  </code></pre>
  
  <p>I expect this to output an actual git log in the specified format. However, all I get is a fatal argument error.</p>
  
  <p>I have also tried the options below, and they also do not work:</p>
  
  <pre><code>LOG="log --pretty=format:\"%h - %an, %ar : %s\""
  LOG='log --pretty=format:\"%h - %an, %ar : %s\"'
  </code></pre>
  
  <p>However, strangely the script below DOES work, and I don't understand why:</p>
  
  <pre><code>LOG='--pretty=format:"%h - %an, %ar : %s"'
  git log "$LOG"
  </code></pre>
  
  <p>It has been argued that shell is considering the variable to be only one argument, however the following works fine:</p>
  
  <pre><code>LOG1LINE='log --pretty=oneline'
  git $LOG1LINE
  </code></pre>