- 使用envsubst
$ envsubst <infile >outfile
! /bin/sh
cat <<EOF
<property>
<name>instanceId</name>
<value>$INSTANCE_ID</value>
</property>
EOF
- 使用envsubst
$ envsubst <infile >outfile
cat <<EOF
<property>
<name>instanceId</name>
<value>$INSTANCE_ID</value>
</property>
EOF
本文标题:如何替换文件中的环境变量
本文链接:https://www.haomeiwen.com/subject/bacnedtx.html
网友评论