In shell scripting the maximum no. of command line parameters becomes 9(Am i right). If we want to get more than 9 parameters we use the shift command.
Even here there are two possibilities.
Without the use of variables - The arguments are lost and the lost no. is equal to the shift in position.
With the use of variables - store the shifted positional parameters in temporary variables like $a, b,c etc. I dont think that this is a nice practice.
But i need some other efficient way of handling these command line parameters. Why is it that shell supports only 9 positional parameters? Why not more???
The exact cutoff point has to do with making the shell easy to code. $10 really would not be easy to support.
But when there are more than a few parameters, the expectation is that the programmer will use a loop. And once you go to a loop, $1 is all you need. In ksh this looks like...
while (($#)) ; do
# do something with $1
shift
done
By the time you do the "shift" you should be finished with $1 and you don't care that it's going away.
ksh also has a getopts built-in command to assist with parameter processing. See this post for an example.