title: How to preserve double quotes in $@ in a shell script?
body: <p>Let's say I have a really simple shell script 'foo':</p>
  
  <pre><code>  #!/bin/sh
    echo $@
  </code></pre>
  
  <p>If I invoke it like so:</p>
  
  <pre><code>  foo 1 2 3
  </code></pre>
  
  <p>It happily prints:</p>
  
  <pre><code>  1 2 3
  </code></pre>
  
  <p>However, let's say one of my arguments is double-quote enclosed and contains whitespace:</p>
  
  <pre><code>  foo 1 "this arg has whitespace" 3
  </code></pre>
  
  <p>foo happily prints:</p>
  
  <pre><code>  1 this arg has whitespace 3
  </code></pre>
  
  <p>The double-quotes have been stripped! I know shell thinks its doing me a favor, but... I would like to get at the original version of the arguments, unmolested by shell's interpretation. Is there any way to do so?</p>