Home >Web Front-end >JS Tutorial >Explanation of how to use $ in shell

Explanation of how to use $ in shell

小云云
小云云Original
2018-02-26 14:05:232253browse

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn