bash 获取环境变量
In Bash, how to get the value (string) of an environment variable?
在Bash中 ,如何获取环境变量的值( 字符串 )?
In Bash, just directly use:
在Bash中 ,只需直接使用:
$VAR
Note that if you assigned a value to the “local” variable $VAR
in your program before reading the “environmental” $VAR
, the $VAR
will actually contain the value you assigned.
请注意,如果在读取 “环境” $VAR
之前为程序中的“本地”变量$VAR
分配了一个值,则$VAR
实际上将包含您分配的值。
Answered by dtivl.
dtivl回答。
翻译自: https://www.systutorials.com/how-to-get-an-environment-variable-in-bash/
bash 获取环境变量