is there an escape character for envsubst?

后端 未结 6 1750
北海茫月
北海茫月 2020-12-29 01:28

Is there a way to prevent envsubst from substituting a $VARIABLE? For example, I would expect something like:

export THIS=THAT
echo         


        
6条回答
  •  臣服心动
    2020-12-29 01:43

    In my case I wanted to only escape vars that aren't already defined. To do so run:

    envsubst "$(env | sed -e 's/=.*//' -e 's/^/\$/g')"

提交回复
热议问题