简体   繁体   English

空环境变量名

[英]Empty enviroment variable name

I'm debugging an application in Ubuntu 20.04 with:我正在调试 Ubuntu 20.04 中的应用程序:

ltrace -e getenv ./cmd

I want to know which enviroment variables and their respective values are involved.我想知道涉及哪些环境变量及其各自的值。 I got surprised when I realized that there is an "empty name variable" without a value.当我意识到有一个没有值的“空名称变量”时,我感到很惊讶。 There is the ltrace output:有 ltrace output:

....
    linux_a64.installos->getenv("")            = nil
    linux_a64.installos->getenv("TMPDIR")      = "/tmp"
    linux_a64.installos->getenv("DEBUGCMD")    = nil
....

Does anyone knows what this could be?有谁知道这可能是什么? There is a way to give an empty value to a enviroment variable?有一种方法可以给环境变量一个空值吗?

Probably this environment variable wasn't set yet.可能尚未设置此环境变量。

$ env | grep POTATO

$ echo $POTATO

You can get the environment variable value, even if that wasn't set before..您可以获得环境变量值,即使之前没有设置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM