get_env/2—retrieve the value of an environment variable
The get_env/2 function retrieves the value of an environment variable. The syntax for this function is as follows:
get_env($ENVVAR,$VALUE)
$VALUE=get_env($ENVVAR)
$VALUE=get_env($ENVVAR)
get_env/2 arguments
Argument | Mode | Type | Description |
---|---|---|---|
$ENVVAR | Input | STRING | Specifies the environment variable name for which the value is to be retrieved |
$VALUE | Output | STRING | Value of the environment variable |
Use the get_env/2 to obtain the value of environment variable $ENVVAR and return the value in $VALUE.
If the specified variable is not defined in the environment, an empty string is returned.
get_env/2 example
$HOME = get_env(HOME);
Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*