0
A
回答
5
"[email protected]"
展开为引用的命令行参数列表。它是微妙的不同从"$*"
:给定
set "a b" c d
"$*"
膨胀以
"a b c d"
而"[email protected]"
膨胀以
"a b" c d
和$*
(或[email protected]
)膨胀以
a b c d
即“$*"
产生单个字符串,但"[email protected]"
复制原始引用,$*
失去引用。
1
man bash
来自:
@
展开为位置参数,从1开始。当扩展出现在双引号内时,每个参数都会扩展为单独的单词。也就是说,“$ @”相当于“$ 1”“$ 2”...如果双引号扩展出现在一个单词内,则第一个参数的扩展与原始单词的开始部分相连,并且扩展最后一个参数的最后部分与原始单词的最后部分连接。
2
这是所有的位置参数,每个双引号。 http://tldp.org/LDP/abs/html/internalvariables.html#APPREF
1
$ @表示传递给脚本的所有参数。
如果你调用一个名为foo.sh这样的脚本:
$> foo.sh boo goo loo
的$ @输出将是这样的:
> boo goo loo
0
当[email protected]
是空的,[email protected]
不展开为空字符串;它被完全删除。因此,无法进行测试:
[ -n "" ]
而是:
[ -n ]
现在-n
不是一个运营商,而只是一个非空字符串,它总是测试为真。
相关问题
- 1. ##或//在bash shell脚本中的含义是什么?
- 2. “|&”在bash中的含义是什么?
- 3. bash脚本是什么:= for?
- 4. '$?'是什么意味着在bash脚本?
- 5. “ENTRY”在链接器脚本中的含义是什么?
- 6. 此行在shell脚本中的含义是什么?
- 7. getopts和IFS在shell脚本中的含义是什么?
- 8. “$$”在shell脚本中的含义是什么?
- 9. bash脚本的以下行是什么?
- 10. 这个bash脚本是做什么的?
- 11. 什么是“本”在Java中的含义是什么?
- 12. 什么VSDCA_Launch在自定义动作脚本中的含义
- 13. 什么意思 - 在bash脚本中?
- 14. shell脚本中'exit 0'的含义是什么?
- 15. 鱼壳脚本中' - *'作为参数的含义是什么?
- 16. sh脚本中“:>”的含义是什么?
- 17. 空白在bash中的含义是什么?
- 18. “1>&2”在bash中的含义是什么?
- 19. $#构造在bash中的含义是什么?
- 20. 什么是=>在我的bash脚本中的意思
- 21. bash脚本代表什么?
- 22. 到底是什么在[expr.ref]/1中提到的脚注的含义是什么?
- 23. 在bash脚本中$ {VAR:-...}和$ {VAR:?...}之间的区别是什么
- 24. 什么是这个AS(动作脚本代码)的含义
- 25. 在sh/Bash shell脚本中,##(bang-pound)是什么意思?
- 26. 如何在bash脚本中包含cron?
- 27. 如何在包中包含bash脚本?
- 28. _._在包装中的含义是什么?
- 29. “++”在PHP中的含义是什么?
- 30. tipbot在LKML中的含义是什么?
请参阅[unix shell编程特殊变量](http://stackoverflow.com/questions/3206312/unix-shell-programming-special-variables) – 2012-04-12 23:17:44