![](/img/trans.png)
[英]How to load ~/.bash_profile when entering bash from within 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
。
對我有用的是以下內容:
source ~/.bash_profile
添加到~/.zprofile
的第一行
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.