Skip to content

Very simple templating system that replace {{VAR}} by $VAR environment value, supports defines

License

Notifications You must be signed in to change notification settings

lavoiesl/bash-templater

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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/

About

Very simple templating system that replace {{VAR}} by $VAR environment value, supports defines

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages