我有以下 YAML 文件来存储我用于 shell 脚本的所有变量。如何将变量之一传递给 shell 脚本?如果可能,请提供示例。
testme:
Numberofservers: 3
EC2InstanceType: m4.2xlarge
DetailedMonitoring: 'true'
TerminationProtection: 'true'
DataEBSVolumeSize: 200
最佳答案
你可以使用这个 bash 脚本 https://gist.github.com/pkuczynski/8665367 读取您的 yaml 并将 yaml 属性作为 bash 变量访问
关于shell - 将 YAML 文件中的变量传递给 shell 脚本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43732100/