我用的zsh,由于平时设置的环境变量都是在.bash_profile文件中,每次重启iterm后,都需要重启手动加载.bash_profile文件,很麻烦。

设置自动加载.bash_profile的方法如下: 
在.zshrc配置文件中调用.bash_profile文件 
打开zsh的配置文件.zshrc,在最后面添加一行代码source /Users/chenchengda/.bash_profile(也可以用相对路径,不过我比较喜欢用绝对路径,不容易出错),这样重启iterm便会自动加载.bash_profile文件了。

相关文章:

  • 2021-12-10
  • 2022-12-23
  • 2021-04-05
  • 2022-12-23
  • 2021-04-01
  • 2022-12-23
  • 2021-11-20
  • 2021-06-17
猜你喜欢
  • 2022-03-04
  • 2021-11-21
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-17
相关资源
相似解决方案