The meaning of $* and $@ is identical when not quoted or when used as a parameter assignment value or as a file name.
However, when used as a command argument, "$*" is equivalent to "$1d$2d..." , where d is the first character of the IFS parameter, whereas "$@" is equivalent to "$1" "$2" ....
本文探讨了Shell脚本中特殊变量*$*与$@的使用差异。当用作命令参数时,*$*展开为由IFS的第一个字符分隔的参数列表,而$@则保持参数的独立性。此外,*$*和$@在未被引用或作为参数赋值及文件名时含义相同。
1360

被折叠的 条评论
为什么被折叠?



