.\" Copyright (c) 1988, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
.\" This code is derived from software contributed to Berkeley by
.\" the American National Standards Committee X3, on Information
.\" %sccs.include.redist.man%
.\" @(#)getenv.3 8.1 (Berkeley) %G%
.Nd environment variable functions
.Fn getenv "const char *name"
.Fn setenv "const char *name" "const char *value" "int overwrite"
.Fn putenv "const char *string"
.Fn unsetenv "const char *name"
These functions set, unset and fetch environment variables from the
For compatibility with differing environment conventions,
may be appended and prepended,
function obtains the current value of the environment variable,
is not in the current environment ,
a null pointer is returned.
function inserts or resets the environment variable
in the current environment list.
does not exist in the list,
it is inserted with the given
If the variable does exist, the argument
variable is not reset, otherwise it is reset
function takes an argument of the form ``name=value'' and is
.Bd -literal -offset indent
deletes all instances of the variable name pointed to by
return zero if successful; otherwise the global variable
is set to indicate the error and a
failed because they were unable to allocate memory for the environment.