linux shell 变量$含义
$开头的变量 测试代码,sh文件名:params.sh #!/bin/bash # $$ Shell本身的PID(ProcessID) printf "The complete list is %s\n" "$$" # $! Shell最后运行的后台Process的PID printf "The complete list is %s\n" "$!" # $? 最后运行的命令的结束代码(返回值) printf "The complete list is %s\n" "$?" # $* 所有参数列表 printf "The complete list is %s\n" "$*" # $@ 所有参数列表 printf "The complete list is %s\n" "$@" # $# 添加到Shell的参数个数 printf "The complete list is %s\n" "$#" # $0 Shell本身的文件名 printf "The complete list is %s\n" "$0" # $1 第一个参数 printf "The complete list is %s\n" "$1" # $2 第二个参数 printf "The complete list is %s\n" "$2 执行命令...