bash设置环境变量_如何在bash中设置环境变量?

bash设置环境变量

How to set an environment variable in bash?

如何在bash中设置环境变量?

The syntax in bash for setting an environment variable is as follows.

bash中用于设置环境变量的语法如下。

export VARIABLE=value

Note that there is no space among the variable, the equals sign (“=”) and the value. If the value has spaces, the value should be put in quotes.

请注意,变量,等号(“ =”)和值之间没有空格 。 如果该值包含空格,则该值应放在引号中。

To check it:

要检查它:

echo $VARIABLE

To show all environment variables set, run env, set (bash build-in command) or printenv.

要显示所有设置的环境变量,请运行env ,set( bash内置命令 )或printenv

To make the variable settings effect for each bash shell, put the exporting command to your ~/.bashrc, the individual per-interactive-shell startup file.

要使每个bash shell的变量设置生效,请将exporting 命令放入~/.bashrc (每个单独的交互式shell启动文件)中。

Answered by anonymous.
匿名回答。

翻译自: https://www.systutorials.com/how-to-set-an-environment-variable-in-bash/

bash设置环境变量

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值