pevhs.ch ~/prog/

gn

This is a small utility with one simple purpose: to read standard input and pass to /bin/sh any text that is between two percent signs. The result is printed to standard output with the result of the commands that were passed to the shell. Example:

$ echo "This is a file printed on %echo -n $(date +%%A)% by %whoami%" >file.txt
$ gn <file.txt
This is a file printed on Saturday by pevhs
$

As you can see, percent signs that mustn't be interpreted must be doubled.

I use it to generate this website, as it allows me to cat header files and things like that inside multiple files pretty easily. One should use it inside of a script as it cannot do much on its own.

Other programs doing the same thing already exist, but I wanted to make my own. Of course, files could brick your machine or leak informations if they contain malicious scripts. Also, be wary of infinite loops.

Source.