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

查看:151
本文介绍了'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.

我最近开始与jenkins合作然后我不得不使用这个导出命令运行jenkins战争档案。所以我需要知道一般的'export'命令是什么,以及为什么我们需要在运行jenkins时运行这个命令(jenkins home设置后)。

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 c $ c> 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.

export 在POSIX 中定义:

export is defined in POSIX:


shell将给出对应于指定名称的变量的export属性,这将导致它们处于随后执行的命令的环境中。如果变量的名称后跟= word,那么该变量的值应设置为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天全站免登陆