1.

What Are Positional Parameters? Explain With An Example?

Answer»

Positional parameters are the VARIABLES defined by a shell. And they are used whenever we need to CONVEY information to the program. And this can be DONE by specifying arguments at the command line.

There are totally 9 positional parameters present i.e. from $1 to $9.

Example: $ Test Indian IT Industry has grown very much faster

In the above STATEMENT, positional parameters are assigned like this.

$0 -> Test (NAME of a shell program/script)

$1 ->Indian

$2 -> IT and so on.

Positional parameters are the variables defined by a shell. And they are used whenever we need to convey information to the program. And this can be done by specifying arguments at the command line.

There are totally 9 positional parameters present i.e. from $1 to $9.

Example: $ Test Indian IT Industry has grown very much faster

In the above statement, positional parameters are assigned like this.

$0 -> Test (Name of a shell program/script)

$1 ->Indian

$2 -> IT and so on.



Discussion

No Comment Found