j2cli is a simple but awesome tool that provides an easy way to template shell scripts, it uses jinja2 as a templating engine
$ sudo pip install j2cli