Based upon How do I make multiple targets from a set of templates for the source?, I would now like to implement a simple-ish templating engine.
I'm quite happy with using sed
for straight replacements, but I'd also like conditionals.
So, for example, if a template looked like this:
This is the file for engine:#if version != 'latest'##version#-#endif#alpine
Output for different versions (7.0 and latest for example).
This is the file for engine:7.0-alpine
This is the file for engine:alpine
Writing that in sed
, whilst possible, does mean I'm having to reinvent the wheel somewhat.
What recommendations for simple templating available for a unix environment?