• 直接看例子
[root@VM-0-12-centos ~]#  cat test.sh
main()
{
echo "param1=$1"
echo "param2=$2"
}

main $*
main $@
main "$*"
main "$@"

[root@VM-0-12-centos ~]# sh test.sh a b
param1=a
param2=b
param1=a
param2=b
param1=a b
param2=
param1=a
param2=b