getenv(3) CLIX getenv(3)
NAME
getenv - Returns the value of a specified environment variable
LIBRARY
Standard C Library (libc.a)
SYNOPSIS
#include <stdlib.h>
char *getenv(
char *name );
PARAMETERS
name Points to a string containing the name of an environment variable.
DESCRIPTION
The getenv() function searches the environment list for a string of the
form name=value, and returns a pointer to a string containing the
corresponding value for name.
EXAMPLES
To return the value of the HOME environment variable:
char *home_directory;
home_directory = getenv("HOME");
RETURN VALUES
The getenv() function returns a pointer to a string containing the value
in the current environment if such a string is present. If such a string
is not present, a NULL pointer is returned.
RELATED INFORMATION
Commands: sh(1)
Functions: putenv(3), clearenv(3)
2/94 - Intergraph Corporation 1