diff options
| author | Benjamin Linskey | 2026-06-07 01:12:26 -0400 |
|---|---|---|
| committer | Benjamin Linskey | 2026-06-07 02:03:56 -0400 |
| commit | 1f47e0501d53883097718c569023461b0931c15a (patch) | |
| tree | c557d3747a56fca634a22c9a6eb25a09821d419b | |
| download | tpl-1f47e0501d53883097718c569023461b0931c15a.tar.gz | |
Add script
| -rwxr-xr-x | template | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/template b/template new file mode 100755 index 0000000..f039439 --- /dev/null +++ b/template @@ -0,0 +1,15 @@ +#!/usr/bin/awk -f + +BEGIN { FS = "[[:space:]]*=[[:space:]]*" } + +FILENAME == ARGV[1] && /^#/ { next } +FILENAME == ARGV[1] && NF == 2 { vals[$1] = $2 } +FILENAME == ARGV[1] { next } + +/\{\{.+\}\}/ { + for (key in vals) { + gsub("\{\{ " key " \}\}"/, vals[key]) + } +} + +{ print } |