$2
–
2nd Positional Parameter
$2
is the value of the second positional parameter.
Links
Examples
- Print 2nd parameter value
1
echo $2
- Print with a fallback value
1
echo ${2-Fallback value}
BashSupport Pro 是一款 Bash 和 POSIX 集成开发环境,支持 $2 - 立即试用!