Environment variables |
$HOME |
Home directory of the current user |
$PATH |
A colon-delimited list of directories to search for commands |
$PS 1 |
A command prompt, usually a $ character, but in bash, you can use some more complex values. For example, the string [\[email protected]\h \w]$ is a popular default value that gives the user name, machine name, and current directory name, as well as a $ prompt. |
$SP 2 |
A second-level prompt that prompts for subsequent input, usually the > character |
$IFS |
Enter a domain prompt. When the shell reads the input, it gives a set of characters used to separate the words, usually space-time grids, tabs, and line breaks |
$ |
The name of the shell script |
$# |
The number of arguments passed to the script |
$$ |
The process number of the shell script, which is typically used by the script to generate a unique temporary file, such as/tmp/tmpfileshell |
Parameter variables |
$1,$2,... |
Parameters of the script program |
$* |
All parameters are listed in a variable, separated by the first character in the environment variable ifs, and the delimited character changes if the IFS is modified |
[Email protected] |
It is an ingenious variant of $* that does not use IFS environment variables, so even if IFS is empty, the parameters will not be squeezed together |
Shell environment variables & parameter variables