We can convey information to a program by specifying arguments at the command line. The shell uses Positional Parameters so that the shell script can know what has been passed to it. They are nine in number, named $1 through $9.
The set command is used to assign values to the positional parameters.
The following program shows the working of the positional parameters
#!/bin/sh set Joys of Programming - Programming made easier and joyful echo $1 $2 $3 $4 $5 $6 $7 $8 $9
Let’s see the output of the program
Joys of Programming - Programming made easier and joyful
The set command sets the value $1 with ‘Joys’, $2 with ‘of’ and so on. We have verified the values using the echo statement.