FLIN(1) User commands FLIN(1)
NAME
flin - A simple templating tool
SYNOPSIS
flin [file...] <template
DESCRIPTION
An extremely simple templating tool, designed for easy use from the
shell. It reads a template from stdin; it writes it back out to std‐
out.
• Purely numeric placeholders like “{n}” are replaced by the contents
of the file given by the nth argument (0-indexed). A trailing new‐
line is removed.
• Alphanumberic placeholders like “{VAR}” are replaced with the value
of the environment variable VAR.
And that's it.
EXAMPLES
Environment variables are interpolated:
$ echo 'Hello, {WORLD}!' | WORLD=earth flin
Hello, earth!
Files are copied in:
$ echo '<html>{0}</html>' | flin inner.html
<html><body>Great website!</body></html>
You can use command substitution:
$ echo '<html>{0}</html>' | flin <(echo '# yeah buddy!' | cmark)
<html><h1>yeah buddy!</h1></html>
The templates are logicless, so you need to do any complex formatting
before the data reaches flin:
$ echo 'In {0} liftoff!' | flin <(seq 3 -1 1 | xargs printf '%s...')
In 3...2...1... liftoff!
AUTHOR
Written by Alex Sayers <alex@asayers.com>.
BUGS
Please report them to: https://todo.sr.ht/~asayers/flin
1a06bb8 FLIN(1)