How to substitute shell variables in complex text files
Looking, it turns out on my system there is an envsubst command which is part of the gettext-base package. So, this makes it easy: Note if you want to use the same file for both, you’ll have to use something like moreutil’s sponge, as suggested by Johnny Utahh: envsubst < “source.txt” | sponge “source.txt”. (Because the shell redirect will … Read more