linux shell template
Replace environment variables in a file with their actual values?
# config.xml <property> <name>instanceId</name> <value>$INSTANCE_ID</value> </property> <property> <name>rootPath</name> <value>/services/$SERVICE_NAME</value> </property> envsubst < config.xml
( echo "cat <<EOF" ; cat config.xml ; echo EOF ) | sh
eval "echo \"$(cat config.xml)\""
(. .env && eval "echo \"$(cat config.xml)\"")
compgen -e | xargs -I @ sh -c 'printf "s|\$%q\>|%q|g\n" "@" "$@"' | sed -f /dev/stdin input.file > output.file