欢迎使用CSDN-markdown编辑器

来源:互联网 发布:淘宝怎么卖眼药水 编辑:程序博客网 时间:2024/05/20 09:26

Mac环境变量设置无效

添加新的环境变量到~/.bash_profile文件,执行“source ~/.bash_profile“,发现无效,并且提示 zsh: command not found:xxx。出现这种情况是因为安装了zsh,其启动不会读取~/.bash_profile,所以配置到~/.bash_profile的参数也不会生效。解决方案是.zshrc中导入.bash_profile,步骤如下:
(1)vim ~/.zshrc
(2)添加source ~/.bash_profile到~/.zshrc
(3)保存退出
(4)重新执行source ~/.zshrc,或重新启动zsh

0 0
原创粉丝点击