Special variables:
$?: The execution result of the previous command returns a value of 0-255,0 for execution success, and other values indicate unsuccessful execution
$!:shell PID of the last running background process
PID of the $$:shell itself
$: Script file path itself file name;
$#: The number of script parameters;
$*: all parameter lists. If "$*" is enclosed in "" ", output all parameters in the form of" $ $ ... $n "
[Email protected]: all Parameters list. such as "[email protected]" with "" "in the case, with" $ "" $ "... Output all parameters in the form "$n"
$1~ $n: Each parameter value added to the shell. $ $ is the 1th parameter, and the $ = is the 2nd parameter ...
By using the following script to demonstrate:
[[email protected] tmp]# vim test$.sh#!/bin/bash echo ' $# ' $# echo ' $ A ' $ Echo ' $ + ' echo ' $ ' $ Echo ' $ $* ' $*[[email protected] tmp]# [[email protected] tmp]#./test\$.sh 3 2 1$# 3$0./test$.sh$1 3$2 2$3 1$* 3 2 1
This article is from the "Wang Liming" blog, make sure to keep this source http://afterdawn.blog.51cto.com/7503144/1863912
Description of special variable $0,$?,$!,$*,$#,$1~ $n of shell species