Closed mstreuhofer closed 6 years ago
I like removing reliance on tools other than bash whenever possible for this project so my vote is for eval+cat, or some other technique that doesn't require sed/awk/perl. Probably an all awk solution would be better than sed+awk. But TBH, I'll completely defer to you guys on this one. This level of text processing wizardry is starting to get out of my depth.
I'd be fine with accepting an improved version, as I don't have the time to invest myself. Removing would be unideal for my own use of the project :)
wrt #98 i have to say that i did not really fix anything. all i did was switch to perl if it is available. the original shell/sed/awk code is still there and it is still broken. so as long as we are all clear about that.. :)
templater.sh does its magic trying to use sed. this works out fine as long as there is no surprise in any env var. this cannot even really be fixed as such because really sed is the wrong tool for this job. possibly use perl where quoting (
\Q
and\E
) can be used or do as most others suggest and use eval+cat. or at least try to replace only vars which actually get referenced in the template and live with the fact that if this variable has unexpected content stuff breaks - right now a sed command is issued for each existing env var. this is bound to break no matter what.opinions? remarks? ideas?