getenv

Gamma: Version 4.0
Prev |  | Next

# `getenv`

`getenv` -- retrieves the value of an environment variable.

## Syntax

    getenv (envar)

## Arguments

`envar`

  A string.

## Returns

A string containing the value of the given environment variable, or nil if the environment variable is not defined.

## Description

This function retrieves the value of an environment variable from the current process's environment. The environment variable must have been set or defined previously by a call to `setenv`.

## Example

        Gamma> setenv("high", "40");
        t
        Gamma> getenv("high");
        "40"
        Gamma> low = 20;
        20
        Gamma> getenv("low");
        nil
        Gamma>

See the Start a Process section of the Common Functions for Any Program chapter (Tutorial Two) in the Cogent Tools Demo and Tutorials book for an example of this function used in context.

## See Also

`setenv`

Prev | Home | Next
`fork` | Up | `gethostname`

Copyright 1995-2002 by Cogent Real-Time Systems, Inc.