加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

Bash中的$@是什么?

发布时间:2020-12-15 19:15:25 所属栏目:安全 来源:网络整理
导读:参见英文答案 What does $@ mean in a shell script?5个答案我认为shell脚本中的句柄$ @是给出脚本的所有参数的数组。这是真的? 我问,因为我通常使用搜索引擎收集信息,但我不能谷歌的$ @,我已经增长太自定义,以轻松获得服务的一切。 是。请参阅特殊参数
参见英文答案 > What does $@ mean in a shell script?5个答案我认为shell脚本中的句柄$ @是给出脚本的所有参数的数组。这是真的?

我问,因为我通常使用搜索引擎收集信息,但我不能谷歌的$ @,我已经增长太自定义,以轻松获得服务的一切。

是。请参阅特殊参数下的bash手册页(您首先要去的)

Special Parameters

The shell treats several parameters specially. These parameters may only be referenced; assignment to them is not allowed.

* Expands to the positional parameters,starting from one. When the expansion occurs within double quotes,it expands to a single word with the value of each parameter separated by the first character of the IFS special variable. That is,"$*" is equivalent to "$1c$2c...",where c is the first character of the value of the IFS variable. If IFS is unset,the parameters are separated by spaces. If IFS is null,the parameters are joined without intervening separators.

@ Expands to the positional parameters,each parameter expands to a separate word. That is,"$@" is equivalent to "$1" "$2" … If the double-quoted expansion occurs within a word,the expansion of the first parameter is joined with the beginning part of the original word,and the expansion of the last parameter is joined with the last part of the original word. When there are no positional parameters,"$@" and $@ expand to nothing (i.e.,they are removed).

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读