How do I set an environment variable on macOs Mojave?

跟風遠走 提交于 2020-01-24 20:52:26

问题


I'm installing 'THERMUS: A Thermal Model Package for ROOT' on macOs Mojave. One of the steps is (after unzipping) the following: "Set an environment variable `THERMUS' to point at the top-level directory containing the THERMUS code". I really don't know what to do. I've seen the other post on stackoverflow: 'no rule to make target' with no reason, but, as I am a beginner, I really don't understand how I should set it. Please help me


回答1:


To set an environment variable on Mac OSX, first open a terminal window. If you are setting the environment variable to run jobs from the command line, use the following command:

export variable=value

where variable is the name of the environment variable (such as programmer) and value is the value you want to assign to the variable, (such as /opt/programmer/suites2013). You can find out which environment variables have been set with the env command.

If you are setting the environment variable globally to use with applications, use the commands given below. The environment variables set by these commands are inherited by any shell or application. OS X 10.10

# To set an environment variable, enter the following command:
launchctl setenv variable "value"

# To find out if an environment variable is set, use the following command:
launchctl getenv variable

# To clear an environment variable, use the following command:
launchctl unsetenv variable


来源:https://stackoverflow.com/questions/56656031/how-do-i-set-an-environment-variable-on-macos-mojave

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!