title: How to preserve single and double quotes in shell script arguments WITHOUT the ability to control how they pass
body: <p>I need to receive arguments I have no control over into a shell script, and preserve any single or double quotes. For instance, a script that simply outputs the given arguments should act as follows:</p>
  
  <pre><code>&gt; my_script.sh "double" 'single' none
  "double" 'single' none
  </code></pre>
  
  <p>I don't have the privilege of augmenting the arguments such as in:</p>
  
  <pre><code>&gt; my_script.sh \"double\" \'single\' none
  </code></pre>
  
  <p>or</p>
  
  <pre><code>&gt; my_script.sh '"double"' "'single'" none
  </code></pre>
  
  <p>And neither "$@" nor "$*" work.
  I also thought of reading from STDIN and try something like:</p>
  
  <pre><code>&gt; echo "double" 'single' none | my_script.sh
  </code></pre>
  
  <p>thinking it may help, but no breakthrough so far.</p>
  
  <p>Any suggestions?</p>
  
  <p>CSH / PERL solutions are welcomed.</p>