Bash: envsubst
将环境变量传递给文件
welcome.txt
This is $FOO and this $BAR
usage
export FOO=foo export BAR=bar
# 全量替换
envsubst < welcome.txt
This is foo and this bar
# 部分替换
envsubst '$FOO' < welcome.txt
This is foo and this $BAR
# 多个变量
envsubst '$FOO,$BAR' < welcome.txt
This is foo and this bar