zsh 每次需要 source ~/.bash_profile

2020-05-19  本文已影响0人  yulekwok

从 macOS Catalina 版开始,您的 Mac 将使用 zsh 作为默认登录 Shell 和交互式 Shell
那么如何不每次运行 source ~/.bash_profile呢
键入以下命令

vim ~/.zprofile

然后 键入i 进行编辑 将下面的粘贴进去即可

if [ -f ~/.bash_profile ]; then
    source ~/.bash_profile
fi

esc :wq 保存退出

这样就不用每次都source ~/.bash_profile 了

上一篇 下一篇

猜你喜欢

热点阅读