设置包含特殊字符$的Heroku配置变量 [英] Setting Heroku config vars that contain the special character $
本文介绍了设置包含特殊字符$的Heroku配置变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图设置一个包含特殊字符 $
的Heroku配置变量,但是我不知道如何正确地对其进行转义.我尝试将其封装在引号中,但得到了相同的结果.
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.
示例:
heroku config:set EMAIL_PASSWORD=xxxxx$xxxxxxxx
=> EMAIL_PASSWORD: xxxxx
heroku config:set EMAIL_PASSWORD="xxxxx$xxxxxxxx"
=> EMAIL_PASSWORD: xxxxx
推荐答案
假设您正在使用Bash(可能在Mac或Linux上使用),则可以使用单引号将 $
,或使用 \
:
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
这篇关于设置包含特殊字符$的Heroku配置变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文