Setting environment variables on OS X

后端 未结 30 3214
你的背包
你的背包 2020-11-21 05:15

What is the proper way to modify environment variables like PATH in OS X?

I\'ve looked on Google a little bit and found three different files to edit:

30条回答
  •  遇见更好的自我
    2020-11-21 05:40

    It's simple:

    Edit ~/.profile and put your variables as follow

    $ vim ~/.profile

    In file put:

    MY_ENV_VAR=value

    1. Save ( :wq )

    2. Restart the terminal (Quit and open it again)

    3. Make sure that`s all be fine:

    $ echo $MY_ENV_VAR

    $ value


提交回复
热议问题