Hi all:
The solution posted by Kanwar is good one (better, smaller and faster)
and is below for ref. Thanks Kanwar... The important point in this
script is the use of "eval". I would like to see more solutions to this
problem.

====================
ctr=$#
while [ $ctr -ge 0 ]
do
   eval echo -ne \$$ctr
   echo -ne " "
   ctr=`expr $ctr - 1`
done
echo

====================


My solution which I said that I will post in a day or
two is below...(not the best I suppose)

 ============= start of solution  =========


 #!/bin/bash
 # set -vx
 echo "Total Parameters : " $#
 echo "Values pased     : " $*

 i=$#

 a=\$i

 while  [ $i -ge 0 ]
 do
         eval export aa=`echo $\` eval echo $a\`  `
         echo -n "$aa "
         i=`expr $i - 1`
 done

 echo ' '

 ============= end of solution  =========


Reply via email to