“导出"命令有什么作用? [英] What does the 'export' command do?

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

问题描述

为了完成任务,我碰巧盲目地运行了一些命令.

I happen to run some commands blindly, in order to get things done.

我最近开始使用 Jenkins,然后我不得不使用此 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. What does the export command do in general, and why do we need to run this command, while running Jenkins (after the Jenkins home is set)?

推荐答案

exportsh 和相关的 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 应将导出属性赋予与指定名称对应的变量,这将使它们处于随后执行的命令的环境中.如果变量名后跟=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.

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

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