Yehuda
Yehuda

Reputation: 1893

How to coordinate bash profile with zsh

I recently switched my shell from bash to zsh. I had set up Anaconda via bash, but now that I'm running zsh as my default shell, I can't find conda or, more importantly, Jupyter. I've figured that to get access to Jupyter I can use exec bash -l, but that seems pointlessly temporary. I would rather access Jupyter locally from zsh. Is there some way to link zsh back to the bash configs?

Upvotes: 1

Views: 4275

Answers (2)

the_mackster
the_mackster

Reputation: 163

I was having an issue with mysql: command not found after I had set the PATH correctly in .bash_profile.

What worked great for me was the following:

  1. Add source ~/.bash_profile to the first line of ~/.zprofile
  2. Restart Terminal

Upvotes: 0

that other guy
that other guy

Reputation: 123570

Since zsh can interpret most of bash, you can have it include the bash init files in its corresponding init files.

To do this, add e.g. the line source ~/.bashrc in ~/.zshrc

Each shell has many different config files and they don't correspond 1:1, so look through and see which ones you want to link. For example, zsh login shells reads both .zlogin and .zprofile, while bash login shells read only the first available of .bash_profile, .bash_login and .profile

Upvotes: 2

Related Questions