“export”命令是做什么的? [英] What does the 'export' command do?

查看:215
本文介绍了“export”命令是做什么的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对Linux有一点新意,我偶然会盲目地运行一些命令,以便完成任务。我以为这样的问题不会浪费,因为有更多的新朋友会定期了解这些问题。

I am a little new to Linux, and I happen to run some commands blindly, in order to get things done. I thought that it will not be a waste of asking these type of questions, since more new people would have a regular knowledge about those.

我最近和詹金斯一起工作然后我不得不使用这个export命令来运行jenkins的war档案。所以我需要知道一般的'export'命令,为什么我们需要在运行jenkins(在设置jenkins之后)运行这个命令。

I started to work with jenkins recently and then I had to use this export command to run the jenkins war archive. So I needed to know what 'export' command does in general, and why we need to run this command while running jenkins(after the jenkins home is set).

谢谢!

推荐答案

export in sh 和相关的shell(例如 bash ),将一个环境变量标记为导出为 - 进程,以便孩子继承它们。

export in sh and related shells (such as bash), marks an environment variable to be exported to child-processes, so that the child inherits them.

导出在POSIX 中定义:

export is defined in POSIX:


shell应该将export属性赋予与指定名称相对应的变量,这将导致它们处于后续执行命令的环境中。如果变量的名称后跟= word,则该变量的值应设置为单词。

The shell shall give the export attribute to the variables corresponding to the specified names, which shall cause them to be in the environment of subsequently executed commands. If the name of a variable is followed by = word, then the value of that variable shall be set to word.

这篇关于“export”命令是做什么的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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