FreeMat

- Main Page
- Related Pages

GETENV Get the Value of an Environment Variable

Section: Operating System Functions

# Usage

The `getenv` function returns the value for an environment variable from the underlying OS. The syntax for the `getenv` function is

       y = getenv(environment_variable)

where `environment_variable` is the name of the environment variable to return. The return is a string.

# Example

Here is an example of using the `getenv` function to get the value for the `HOME` variable

    --> getenv('HOME')

    ans =
    /home/sbasu