The first parameter to the shell is known as $1, the second as $2, etc. The collection of ALL parameters is known as $*.
Consider the following as an example (file prog):
#!/bin/sh echo the first parameter is $1 echo the second parameter is $2 echo the collection of ALL parameters is $* exit 0The output of that program could be:
sh_prompt;SPMgt; prog first second
the first parameter is first
the second parameter is second
the collection of ALL parameters is first second
sh_prompt;SPMgt;
Only nine parameters can be read using the $number scheme. The $* along with the shift instruction is one way to read the remainder of the parameters. Another way is to use the for var in $* command, to be described in the upcoming Control Structures section.