我正在尝试使用bash的envsubst将一个环境变量替换到一个文件中。这里有一个简单的例子,它不能像预期的那样工作: 创建一个包含变量替换的文件: echo 'Filename: ${FILE}' > test.txt 现在尝试在for循环中使用envsubst: forFILE in `ls`; do envsubst < test.txt; done
Filename: 结果就是Filename:替换失败。在此上下文中,Echo按预期工作: for FILE in `ls`; do echo File
此函数在运行命令的其他函数中调用,除了envsubst命令外,它似乎按预期工作。file named $2 from $1 by substituting environment variables within it" service.beta.kubernetes.io/azure-load-balancer-internal: "true"
[SUCCESS] Command envsubst</