当没有双引号时,$*和$@扩展为每个位置参数
出现在双引号中,"$*"扩展为将所有位置参数通过IFS(通常为空格)拼接为单个参数,而"$@"任然扩展为每个位置参数
./test.sh hello javacoder.cn
------test for $*--------
hello---
javacoder.cn---
------test for "$*"--------
hello javacoder.cn---
------test for $@--------
hello---
javacoder.cn---
------test for "$@"--------
hello---
javacoder.cn---
Posted in: Linux
Comments are closed.