Very simple templating system that replace {{VAR}} by $VAR environment value, supports defines
Switch branches/tags
Nothing to show
Clone or download
guillermocalvo and lavoiesl Allow whitespace inside braces (#3)
Modify the example template to incorporate spaces
Latest commit 265e91f Jan 31, 2018
Permalink
Failed to load latest commit information.
examples Allow whitespace inside braces (#3) Jan 31, 2018
.travis.yml Add travis-ci Jan 31, 2018
LICENSE Create LICENSE Jan 13, 2017
README.md Update README.md Jan 31, 2018
templater.sh Allow whitespace inside braces (#3) Jan 31, 2018
test.sh Add travis-ci Jan 31, 2018

README.md

BASH Templater

Very simple templating system that replace {{VAR}} by $VAR environment value.

Supports default values by writting {{VAR=value}} in the template.

Build Status

Author

Sébastien Lavoie github@lavoie.sl

See http://blog.lavoie.sl/2012/11/simple-templating-system-using-bash.html for other details

Usage

# Passing arguments directly
VAR=value templater.sh template

# Evaluate /tmp/foo and pass those variables to the template
# Useful for defining variables in a file
# Parentheses are important for not polluting the current shell
(set -a && . /tmp/foo && templater.sh template)

# A variant that does NOT pass current env variables to the templater
sh -c "set -a && . /tmp/foo && templater.sh template"

Examples

See examples/