$*,“$*”,[email protected],"[email protected]"的区别

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

原文地址:http://blog.51cto.com/12040328/2307145

时间: 2024-10-24 20:10:41