getEnv

Syntax

getEnv(name, [default])

Arguments

name is a STRING scalar indicating the name of an environment variable.

default is a STRING scalar indicating the value to be returned when the environment variable does not exist. If it is unspecified, return an empty string.

Details

Return the value of the specified environment variable. Otherwise return default.

Examples

getEnv("path")
// output
C:\ProgramData\DockerDesktop\version-bin;C:\Program Files\Docker\Docker\Resources\bin;

getEnv("JAVA_HOME");
// output
C:\Program Files\Java\jdk1.8.0_191

getEnv("not_exist","not exist")
// output
not exist