Created
February 14, 2023 09:17
-
-
Save ljyloi/423350245ad966a374e6e7c761cd2ee7 to your computer and use it in GitHub Desktop.
利用 bash 通过模版文件生成最终文件
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
export sample="Hello Yaml!" | |
export nats_machines="10.2.3.4" | |
export nats_username="nats" | |
export nats_password="password" | |
rm -f final.yml temp.yml | |
( echo "cat <<EOF >final.yml"; | |
cat template.yml; | |
echo "EOF"; | |
) >temp.yml | |
. temp.yml | |
cat final.yml |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment