github TekWizely/bash-tpl v0.9.0
Format Specifiers on Template Tags - v0.9.0

5 days ago

Bash-TPL

A Smart, Lightweight shell script templating engine, written in Bash.

Release - v0.9.0

This release introduces the ability to include a printf format-specifier in your Text Tags.

Full Changelog: v0.8.0...v0.9.0

Quick Example

By default, all Text Tags are rendered with the printf %s format specifier:

default_format.tpl

% myint=123
<% ${myint} %>

process the template

$ bash-tpl default_format.tpl

myint=123
printf "%s\n" "${myint}"

Now you can include a custom format specifier in your tags:

integer_format.tpl

% myint=123
<%| %d | ${myint} %>

process the template

$ bash-tpl integer_format.tpl

myint=123
printf "%d\n" "${myint}"

To learn about format specifiers, including customizing the delimiters, see the README

Don't miss a new bash-tpl release

NewReleases is sending notifications on new releases.