繁体   English   中英

如何协调 bash 配置文件与 zsh

[英]How to coordinate bash profile with zsh

我最近将我的 shell 从 bash 切换到 zsh。 我已经通过 bash 设置了 Anaconda,但现在我正在运行 zsh 作为我的默认 shell,我找不到 conda,或者更重要的是,找不到 Jupyter。 我认为要访问 Jupyter,我可以使用exec bash -l ,但这似乎是临时性的。 我宁愿从 zsh 在本地访问 Jupyter。 有什么方法可以将 zsh 链接回 bash 配置吗?

由于 zsh 可以解释大部分 bash,因此您可以让它在其相应的 init 文件中包含 bash init 文件。

为此,请在~/.zshrc中添加例如 line source ~/.bashrc

每个 shell 都有许多不同的配置文件,它们不是 1:1 对应的,因此请查看您要链接的文件。 例如,zsh 登录 shell 读取.zlogin.zprofile ,而 bash 登录 shell 仅读取.bash_profile.bash_login.profile的第一个可用

我在 mysql 中遇到问题:在.bash_profile中正确设置 PATH 后mysql: command not found

对我有用的是以下内容:

  1. source ~/.bash_profile添加到~/.zprofile的第一行
  2. 重启终端

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM