help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-bash] bash way of variable substitution


From: Greg Wooledge
Subject: Re: [Help-bash] bash way of variable substitution
Date: Mon, 12 Feb 2018 08:50:16 -0500
User-agent: NeoMutt/20170113 (1.7.2)

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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]