Skip to content

Instantly share code, notes, and snippets.

@hoodja
Created March 18, 2013 22:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hoodja/5191441 to your computer and use it in GitHub Desktop.
Save hoodja/5191441 to your computer and use it in GitHub Desktop.
function render {
cat << END_RENDER
#begin the "real" content
blah $FOO
foo $BAR
smack $HEAD
for $USER
#end the "real" content
END_RENDER
}
#!/bin/bash
source variables
source file.template
render
#These are defaults but can be overridden by a like-named environment variable
FOO=${FOO:="Some Value"}
BAR=${BAR:="Another Value"}
USER=${USER:="Jimbo"}
HEAD=${HEAD:="I dunno"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment