I have an nginx conf file that due to using environment variables, I have a shell script echo, this file I refer to as nginx.conf.template, then I place the echoed result into the actual nginx.conf, see shell script bellow:
#!/bin/sh
function subst() { eval echo -E "$2"; }
mapfile -c 1 -C subst < nginx.conf.template > nginx.conf
The only issue I have with this is that it removes all whitespace for indentation, I imagine this would cause an issue, but the docker container that I am running this nginx server in seems fine. Does it matter that I have no indentations? If it does matter, can echo preserve said whitespace?