Zsh ≠ Bash
As such, Zsh doesn’t source Bash’s .bash_profile
. You need a .zprofile
to be configured.
One quick (and dirty) way to get what’s in your .bash_profile
into your Zsh .zprofile
is to issue the command:
echo “. $HOME/.bash_profile” >> ~/.zprofile
This will cause .zprofile
to source .bash_profile
every time an interactive shell is opened. The commands appends what’s in the quotes to .zprofile
- the command to source .bash_profile
. It will create the file if it doesn’t exist.
It is much, much perferable however, to create a proper .zprofile
because while mostly compatible with each other there are subtle difference that could break things (i.e. a colorized prompt).
As you’re starting with a new shell, this is an excellent opportunity to put things is the right place. See this Q&A ZSH: .zprofile, .zshrc, .zlogin - What goes where? for a more detailed look into what shell configuration files go where and what they do.
echo $0
at the prompt to find out. What other init files do you have present like.bashrc
or.zprofle
? It helps immensely if you identify the version of macOS you’re on; please [edit] the question with that info. – Allan Apr 18 '23 at 18:09zsh
. The only other files beginning with.
that I see under home is – David Apr 18 '23 at 18:11.zprofile
with a single line that sources your.bash_profile
but I don’t recommend that. See: https://apple.stackexchange.com/q/388622/119271 – Allan Apr 18 '23 at 18:13.bash_profile
, a file written for bash shell language, from a different shell? – user1934428 Apr 24 '23 at 09:18