Explanation of the meaning of shell variables $#,$@,$0,$1,$2 in Linux:
Variable description:
$$
Shell’s own PID (ProcessID)
$!
The PID of the background Process that Shell last ran
$?
The end code (return value) of the last command run
$-
List of Flags set using the Set command
$*
All parameter list. If "$*" is enclosed in """, all parameters will be output in the form of "$1 $2 ... $n".
$@
All parameter list. For example, if "$@" is enclosed in """, all parameters will be output in the form of "$1" "$2" ... "$n".
$
#The number of parameters added to the Shell
$0
The file name of the Shell itself
$1~$n
The value of each parameter added to the Shell. $1 is the first parameter, $2 is the second parameter….
The above is the detailed content of Explanation of how to use $ in shell. For more information, please follow other related articles on the PHP Chinese website!