title: Storing ksh input array to variable and passing to another script
body: <p>I have to modify an existing ksh script which looks at the command-line arguments using 'shift', and so empties $@, but now want to pass the original arguments to a second script afterwards. </p>
  
  <p>In the mainline case I can do this by coping $@ to a variable and passing that to the second script, but I can't get it to work for quoted command-line arguments.</p>
  
  <p>If I have a script called 'printer' like below:</p>
  
  <pre><code>#!/bin/ksh
  
  INPUT=$@  
  echo "Printing args"
  until [[ $# -eq 0 ]];do
     echo $1
     shift
  done
  
  ./printer2 $INPUT
  </code></pre>
  
  <p>and printer2 like below:</p>
  
  <pre><code>#!/bin/ksh
  
  echo "Printing second args"
  until [[ $# -eq 0 ]];do
     echo $1
     shift
  done
  </code></pre>
  
  <p>I would like the output of </p>
  
  <pre><code>./printer first second "third forth"
  </code></pre>
  
  <p>to be :</p>
  
  <pre><code>Printing args
  first
  second
  third forth
  Printing second args
  first
  second
  third forth
  </code></pre>
  
  <p>I've tried various combinations of quotes around variables (both in the assignment of $INPUT  and when passing it to printer2) but can't figure it out. Can anyone help?</p>