On Sun, Feb 11, 2018 at 12:03:46PM -0600, Peng Yu wrote:
> > check http://mywiki.wooledge.org/TemplateFiles
>
> It seems that envsubst does not serve the purpose.
WHAT purpose? How are we supposed to guess what your desired output is?
> $ envsubst <<< '\\\$a'
> \\\
It replaced $a with the value of that environment variable. Is that
not what you wanted?
Did you intend for the preceding backslashes to be significant? In
what way? What did you expect the output to be, and why?
Are you trying to write a bash syntax parser? There is only one bash
syntax parser in the entire world, and that is bash itself. Every
other thing that tries to parse bash syntax (text editors doing colors,
etc.) inevitably fails to meet some weird corner case.