如何在macOs Mojave上设置环境变量? [英] How do I set an environment variable on macOs Mojave?

查看:128
本文介绍了如何在macOs Mojave上设置环境变量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要在macOs Mojave上安装"THERMUS:ROOT的热模型包".步骤之一是(解压缩后)以下内容:设置环境变量'THERMUS'指向包含THERMUS代码的顶级目录".我真的不知道该怎么办. 我看过关于stackoverflow的另一篇文章:没有规则可以成为目标" '没有任何理由,但是作为我的初学者,我真的不知道该如何设置.请帮助我

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

推荐答案

要在Mac OSX上设置环境变量,请首先打开一个终端窗口. 如果要设置环境变量以从命令行运行作业,请使用以下命令:

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

其中,变量是环境变量的名称(例如,程序员),而值是要分配给该变量的值(例如,/opt/programmer/suites2013).您可以找出使用env命令设置了哪些环境变量.

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.

如果要全局设置环境变量以与应用程序一起使用,请使用下面给出的命令.这些命令设置的环境变量可被任何外壳程序或应用程序继承. OS X 10.10

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

这篇关于如何在macOs Mojave上设置环境变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆