macOS Catalina 10.15(beta) - Why is ~/.bash_profile not sourced by my shell?

前端 未结 9 627
北荒
北荒 2020-12-12 10:31

I want to set the environment variable I added below the line to ~/.bash_profile and ~/.profile but it didn\'t work.

export JBOSS_H         


        
9条回答
  •  遥遥无期
    2020-12-12 11:02

    After you close a Terminal window, variables you set in that window are no longer available. If you want the value of a variable to persist across sessions and in all Terminal windows, you must set it in a shell startup script. For information about modifying your zsh shell startup script to keep variables and other settings across multiple sessions, see the “Invocation” section of the zsh man page.

    You can use ~/.zlogin to add your variables.

    Check out this reference.

提交回复
热议问题