linux - shell命令末尾的 "$*"是什么意思

标签 linux shell

在示例 shell 脚本中,命令是 -

. <sourced_file.sh> $*

$* 是什么意思? 谢谢。

最佳答案

$* 扩展为提供给它出现的脚本的所有参数,或者扩展为当前 shell 函数(如果它出现在函数内部)。

虽然它通常是不正确的用法,因为它将包含空格的参数分解为多个参数。更正确的是 "$@",它保留原始参数,即使它们中有空格也是如此。

关于linux - shell命令末尾的 "$*"是什么意思,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8817369/

相关文章:

php - 为 imagecreatefromstring 函数和发送电子邮件在 Linux 上的 PHP 中启用 GD

c++ - gcov-工具合并 : "not a gcov data file"

c++ - 线程: I want to pass a struct pointer in main to a function called by pthread

linux - 如何通过 'wmctl' 和 'ps' 获得 X 应用程序的完整命令?

bash - 根据 Bash 中的输入生成逗号分隔的数字序列

linux - 如何在 bash if/else 中使用双重 grep 比较?

linux - 外壳脚本 : execute 2 commands and keep first running

android - 如何在 Android 和 Linux 上将 JPG 文件解码为相同的位图?

bash - 如何为 bash 详细模式设置前缀

linux - 查找用于搜索可执行程序的路径?