Skip to main content

getenv

Function getenv 

Source
pub fn getenv(varname: string) -> option<string>
Expand description

Reads an environment variable.

§Parameters

  • varname: the name of the environment variable.

§Return value

The value of the process environment variable varname, or nil if the variable is not defined.

§Examples

print(os.getenv("HOME"))          --> /home/ana
print(os.getenv("NO_SUCH_VAR"))   --> nil