Process status variable
1. $ get the current shell process ID (PID)
2. $! PID used to execute the previous command
3. $? Obtain the return value for executing the previous command (0 indicates success, and non-zero indicates failure, which is very common)
4. $ _ the last parameter of the command or script previously executed
Cat> test $. shecho '$ =' $ echo '$! = '$! Echo '$? = '$? Echo '$ @ =' $ @ echo '$ _ =' $ _ # output the following sh test \ $. sh 1 2 3 $ = 2556 $! = $? = 0 $ @ = 1 2 3
$ * And $ @
$ * Treat all parameters as a single string, equivalent to "$1 $2 $3"
$ @ Treat each parameter as a single string and retain any blank characters in the command line
Set -- 'I am' jane leefori in $ *; doecho $ I; done; Iamjaneleefori in $ @; doecho $ I; done; Iamjaneleefori in "$ @"; doecho $ I; done; I amjaneleefori in "$ *"; doecho $ I; done; I am jane lee