Setting Heroku config vars that contain the special character $

荒凉一梦 提交于 2021-02-18 21:16:24

问题


I am trying to set a Heroku config variable that contains the special character $ but I do not know how to properly escape it. I tried encapsulating it in quotes but got the same result.

Example:

heroku config:set EMAIL_PASSWORD=xxxxx$xxxxxxxx
=> EMAIL_PASSWORD: xxxxx

heroku config:set EMAIL_PASSWORD="xxxxx$xxxxxxxx"
=> EMAIL_PASSWORD: xxxxx

回答1:


Assuming you are using Bash (which is likely if you are on Mac or Linux) you can use single quotes to escape strings with $, or use \:

$ echo $FOO

$ echo "$FOO"

$ echo '$FOO'
$FOO
$ echo \$FOO
$FOO


来源:https://stackoverflow.com/questions/22417501/setting-heroku-config-vars-that-contain-the-special-character

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!