gpt4 book ai didi

bash - $* 在 bash 脚本中意味着什么?

转载 作者:太空宇宙 更新时间:2023-11-04 04:01:26 25 4
gpt4 key购买 nike

$* 在 bash 脚本中意味着什么?

我尝试在 google 上搜索它,但只找到了 $0$1 等内容。

最佳答案

man 页面:

* 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.

因此它相当于所有位置参数,但语义略有不同,具体取决于它是否在引号中。

关于bash - $* 在 bash 脚本中意味着什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22810804/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com