3 ms·
I chose M4 for $WORK to use in a context where we had config files with templated environment values and we didn't want to depend on a programming language for
by Karrot_Kream 4y ago
I chose M4 for $WORK to use in a context where we had config files with templated environment values and we didn't want to depend on a programming language for those templates. Since the configs were created and placed on container start, M4 came with the base image and was easy to use just to set a few values in the template that depended on the container environment.
The whole thing works with having a "template file" which looks mostly like the config with a couple M4 macros to source envars. Envar sourcing logic came from a base M4 file we included in each template at the top. There were a couple sharp edges with escaping but the obviousness of the whole setup made M4 fine. If M4 was a bit easier to work with I'd love to use it for something more complicated, but for our purposes it was fine.