template.txt contains: Hello ${NAME} Then you could run: export NAME=Dan envsubst < template.txt And the result would be "Hello Dan"