title: Shell script fails when trying to set the date
body: <p>with a basic shell script such as</p>
  
  <pre><code>USER=$1
  CMD=$2
  
  /usr/bin/sudo -u $USER $CMD
  </code></pre>
  
  <p>I can run</p>
  
  <pre><code># ./script.sh root "/bin/echo 'apple pie'"
  'apple pie'
  </code></pre>
  
  <p>However trying instead:</p>
  
  <pre><code>#/script.sh root "/bin/date -s '2011-08-24 15:24:30'"
  date: the argument `15:24:30\'' lacks a leading `+';
  when using an option to specify date(s), any non-option
  argument must be a format string beginning with `+'
  Try `date --help' for more information.
  </code></pre>
  
  <p>I can replicate the date error by manually typing </p>
  
  <pre><code>/bin/date -s \'2011-08-24 15:24:30\'
  date: the argument `15:24:30\'' lacks a leading `+';
  when using an option to specify date(s), any non-option
  argument must be a format string beginning with `+'
  Try `date --help' for more information.
  </code></pre>
  
  <p>So my problem then with using date in this script is that the single-quotes are getting automatically escaped which date does not like. I can change the script to be based on $1 $2 $3 "$4" but that removes the general purpose nature of this script (which has been simplified for this post).</p>
  
  <p>Any ways to make a script of this nature support the date case without special casing it?</p>