【问题标题】:How to coordinate bash profile with zsh如何协调 bash 配置文件与 zsh
【发布时间】:2020-09-19 01:31:05
【问题描述】:

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

【问题讨论】:

  • 你可以把source ~/.bashrc放在你的.zshrc中,同样地从.zprofile获取.bash_profile
  • @thatotherguy 你的意思是~/.profile?我在.bashrc.bash_profile 中都没有看到任何配置。无论哪种方式,它都与.profile 一起工作,作为答案,我可以相信你。
  • 你为 bash 修改的哪个文件,zsh 目前不读取

标签: bash shell command-line


【解决方案1】:

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

为此,添加例如source ~/.bashrc 中的行 ~/.zshrc

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-02-24
    • 1970-01-01
    • 2018-04-26
    相关资源
    最近更新 更多