[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的進程號;