Positional parameters in the Bourne shell
When you run a shell procedure, the shell implicitly creates positional parameters that reference each word on the command line by its position on the command line.
The word in position 0 (the procedure name) is called $0
,
the next word (the first parameter) is called $1
, and so
on, up to $9
. To refer to command line parameters numbered
higher than 9, use the built-in shift command.
You can reset the values of the positional parameters explicitly by using the built-in set command.
Note: When an argument for a position is not specified, its positional
parameter is set to null. Positional parameters are global and can be passed
to nested shell procedures.