Dynamics param for script

Hi everyone,

I need a way to take the value of a parameter with a for lood. For example i execute the script with this parameter

./Script PARAM1 PARAM2 PARAM3 PRAM4
for i in <LIST OF PARAMETERS>
do
     PARAMETERS=$<NUMBER OF PARAMETER>
done

How can i express <LIST OF PARAMETERS> and <NUMVER OF PARAMETERS>?

Thanks!

Sorry for my english.

NOTE: the numbers of parameters is not the same allways.

Consider the following:

#!/bin/sh

printf 'number of parameters: %d\n' $#

printf 'all parameters:\n'
printf '\t%s\n' "$@"

printf 'looping\n'

for p; do
  printf '\t%s\n' "$p"
done

It produces the following output with different parameters:

zsh-4.3.12[t]% ./params one two
number of parameters: 2
all parameters:
        one
        two
looping
        one
        two
zsh-4.3.12[t]% ./params three four five
number of parameters: 3
all parameters:
        three
        four
        five
looping
        three
        four
        five

If for <varname>; do ... doesn't work
with your shell, be more explicit:

for <varname> in "$@"; do ... 

Some shells provide the getopts builtin for more advanced parameter parsing.