[root@centos test]# cat test.sh echo $0 [root@VM_102_244_centos test]# bash test.sh test.sh #包括路径 [root@VM_102_244_centos ~]# bash ~/test/test.sh /root/test/test.sh
[root@VM_102_244_centos test]# cat test.sh echo $1 $3 ${10} [root@VM_102_244_centos test]# bash test.sh a b c d e f g h e i g k a c i
$#:传递到脚本的参数数量; $*和$@:传递到脚本的全部参数; $?:推出状态;0表示无错误;1表示有错误; $$:脚本运行的进程号,即当前shell的进程号;