小编Jus*_*tin的帖子

从变量引用 bash 变量

如何在 bash 中基于另一个变量引用一个变量?让我设置一下示例:

package="foobar"

# the variable I wish to reference is $foobar_darwin_amd64
# thus trying:
echo "$package_darwin_amd64"
Run Code Online (Sandbox Code Playgroud)

但这是行不通的。

bash variable-substitution

3
推荐指数
1
解决办法
3万
查看次数

标签 统计

bash ×1

variable-substitution ×1