Positional parameters are nothing but a series of command line arguments passed to a shell script. Positional parameters can be used to pass information to a script.The following are some of the positional parameters used in shell script.
$0 ----- refers to the name of command or shell script itself
$* ----- stands for all the command line arguments supplied starting from $1
$# ----- Total number of arguments supplied.
$1,$2....$9 ---- positional parameters supplied to a program .
$* ----- all the arguments are double quoted. For example if a script receives
two arguments, then $* is equivalent to $1 $2
$@ ------ works similar to $*
$? ----- exit status of the last command supplied.
$$ ----- the process number of the current shell
$! ----- the process number of the last back ground shell.
No comments:
Post a Comment