.\" Copyright (c) 1988 The Regents of the University of California.
.\" %sccs.include.redist.man%
.\" @(#)getenv.3 6.9 (Berkeley) %G%
getenv, putenv, setenv, unsetenv \- manipulate environmental variables
getenv(const char *name);
setenv(const char *name, const char *value, int overwrite);
putenv(const char *string);
unsetenv(const char *name);
searches the environment list (see
for a string of the form \fIname\fP\fB=\fP\fIvalue\fP and returns
if such a string is present, and a NULL pointer if it is not.
searches the environment list as
is not found, a string of the form \fIname\fP\fB=\fP\fIvalue\fP is
added to the environment.
is non-zero, its value is changed to
returns 0 on success and -1 on failure, setting the external variable
takes an argument of the form ``\fIname\fR=\fIvalue\fR'' and is the
removes all occurrences of the string
There is no library provision for completely removing the current
It is suggested that the following code be used to do so.
All of these routines permit, but do not require, a trailing equals
or a leading equals sign on
failed because they were unable to allocate memory for the environment.
csh(1), sh(1), execve(2), environ(7)
conforms to ANSI X3.159-1989 (``ANSI C'').