[root@usr001 ~]# set -- "I am" handsome boy #传参数 [root@usr001 ~]# echo $# #打印参数个数 3 [root@usr001 ~]# for i in $;do echo $i;done I am handsome boy [root@usr001 ~]# for i in $@;do echo $i;done I am handsome boy [root@usr001 ~]# for i in "$@";do echo $i;done I am handsome boy [root@usr001 ~]# for i in "$";do echo $i;done #把三个参数看成一个参数 I am handsome boy [root@usr001 ~]# for i;do echo $i;done I am handsome boy [root@usr001 ~]#