项目作者: lavoiesl

项目描述 :
Very simple templating system that replace {{VAR}} by $VAR environment value, supports defines
高级语言: Shell
项目地址: git://github.com/lavoiesl/bash-templater.git
创建时间: 2012-11-01T17:18:08Z
项目社区:https://github.com/lavoiesl/bash-templater

开源协议:MIT License

下载


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

  1. # Passing arguments directly
  2. VAR=value templater.sh template
  3. # Evaluate /tmp/foo and pass those variables to the template
  4. # Useful for defining variables in a file
  5. # Parentheses are important for not polluting the current shell
  6. (set -a && . /tmp/foo && templater.sh template)
  7. # A variant that does NOT pass current env variables to the templater
  8. sh -c "set -a && . /tmp/foo && templater.sh template"

Examples

See examples/