在mac中添加环境变量的问题

mac中加入环境变量,直接修改~/.bash_profile:

open ~/.bash_profile

在末尾加入:

export PATH="/Users/***/Programs/firefoxDriver:$PATH"

保存退出,回到终端中输入:

source ~/.bash_profile

这方法总是无效。后来使用以下命令:

echo 'export PATH="/Users/***/Programs/firefoxDriver:$PATH"' >> ~/.bash_profile
source ~/.bash_profile

这时成功了。
打开~/.bash_profile,看到里边添加的就是:

export PATH="/Users/***/Programs/firefoxDriver:$PATH"

可是手动在~/.bash_profile中添加就无效。真奇怪。


如果本文对您有帮助,请给我留个言。谢谢!

猜你喜欢

转载自blog.csdn.net/qq_41090453/article/details/82772308