Sigil is a command line tool for template processing and POSIX-compliant variable expansion. It was created for configuration templating, but can be used for any text processing.