1

I never paid attention and didnt need it much but realised: I am using iterm with -zsh, not bash on my mac. I do however have a bash_profile file AND a .zshrc file. As I understand from researching, if I use zsh, I add environment variables not to a bash_profile file but to a zshenv or zshrc file.

I for some reason do not have a zshenv file but have the bash_profile AND a zshrc file where I have added enviroment variables in the past.

Am I correct to say that anything I added in my bash_profile file have no use as im using zsh shell? Is it right to keep adding things to my zshrc file or do I need to create a zshenv file? Im quite confused. An answer would be very much appreciated! Thank you!!

oguz ismail
  • 1
  • 16
  • 47
  • 69
  • 1
    `zshrc` doesn't mean anything to zsh. `.zshrc` does - same with the bash equivalents. Unless it has a `.` in front the shell will ignore it by default. zsh will ignore the bash files and vice-versa. In short, add things to `~/.zshrc`. – keithpjolley Mar 12 '23 at 15:47
  • 1
    fyi this should be posted to [apple.se] or [unix.se]; it's off-topic here though. – David Makogon Mar 12 '23 at 15:47
  • Than you @keithpjolley .So the .zshenv file is then also unimportant as long as I add the variables to my .zshrc file?! –  Mar 12 '23 at 16:17
  • 1
    If you are wondering where stuff SHOULD go. I think most people just use ~/.zshrc and don't worry about the others. I used to worry about all the different files until I got tired of keeping track of such stuff. https://zsh.sourceforge.io/Intro/intro_3.html – keithpjolley Mar 12 '23 at 16:38

0 Answers0