【问题标题】:env not reading variables in ./profile on new sessionenv 未在新会话中读取 ./profile 中的变量
【发布时间】:2023-03-11 01:30:01
【问题描述】:

我在这里可能做错了什么,但是当我编辑我的.profile 文件并设置一个新的PATH 变量时,我无法在开始新会话时看到它设置。

所以在保存.profile 文件后,我打开一个新的终端窗口,输入env 并且变量不存在。

我错过了什么?

谢谢

【问题讨论】:

    标签: macos path environment-variables .bash-profile


    【解决方案1】:

    我认为“.profile”只有在作为登录 shell 调用时才会被读取。您可以尝试将这些变量放入您的“.bashrc”文件中。

    【讨论】:

    • 谢谢。我刚试过你的建议。同样的结果,当我运行一个新的终端会话时,env 不存在。
    猜你喜欢
    • 2013-03-07
    • 2013-08-03
    • 1970-01-01
    • 2015-12-18
    • 2020-07-01
    • 1970-01-01
    • 2015-04-28
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多