Variable Description:
$$
the PID of the shell itself (ProcessID)
$!
PID of the Shell's last running background process
$?
end code of the last Run command (return value)
$-
flag at a glance using the SET command
$*
all parameter lists. such as "$*" in the Case of "" ", in the form of" $ $ ... $n "output all parameters.
[email protected]
all parameter lists. such as "[email protected]" with "" "in the case, with" $ "" $ "... All parameters are output in the form "$n".
$#
number of arguments added to the shell
$
the name of the shell itself
$1~ $n
each parameter value added to the shell. $ $ is the 1th parameter, and the $ = is the 2nd parameter ....
Example:
1 #!/bin/bash
2 #
3 printf "The complete list is%s\n" "$$ "
4 printf "The Complete list is%s\n" "$! "
5 printf "The complete list is%s\n" "$?"
6 printf "The complete list is%s\n" "$* "
7 printf "The Complete list is%s\n" "[email protected]"
8 printf "The complete list is%s\n" "$# "
9 printf "The complete list is%s\n" " $ A"
printf "The complete list is%s\n" " $"
printf "The complete list is%s\n" " $
results:
[email protected] ~]$ bashparams.sh 123456 QQ
The complete listis24249
The complete listis
The complete listis0
The complete listis123456 QQ
The complete listis123456
The complete listisqq
The complete listis2
The complete listisparams.sh
The complete listis123456
The complete listisqq
Linux shell variable $#,[email protected], $*,$?,$$,$!,$_,$0,$1,$2 meaning explanation