Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lavoiesl/bash-templater
Very simple templating system that replace {{VAR}} by $VAR environment value, supports defines
https://github.com/lavoiesl/bash-templater
shell
Last synced: 2 months ago
JSON representation
Very simple templating system that replace {{VAR}} by $VAR environment value, supports defines
- Host: GitHub
- URL: https://github.com/lavoiesl/bash-templater
- Owner: lavoiesl
- License: mit
- Created: 2012-11-01T17:18:08.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2021-01-07T10:59:23.000Z (almost 4 years ago)
- Last Synced: 2024-02-13T21:52:16.893Z (11 months ago)
- Topics: shell
- Language: Shell
- Size: 8.79 KB
- Stars: 54
- Watchers: 4
- Forks: 61
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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](https://travis-ci.org/lavoiesl/bash-templater.svg?branch=master)](https://travis-ci.org/lavoiesl/bash-templater)
## Author
Sébastien Lavoie
See http://blog.lavoie.sl/2012/11/simple-templating-system-using-bash.html for other details
## Usage
```sh
# 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/