mdoc version three
[unix-history] / usr / src / usr.bin / printenv / printenv.1
.\" Copyright (c) 1980, 1990 The Regents of the University of California.
.\" All rights reserved.
.\"
.\" This code is derived from software contributed to Berkeley by
.\" the Institute of Electrical and Electronics Engineers, Inc.
.\" %sccs.include.redist.roff%
.\"
.\" @(#)printenv.1 6.7 (Berkeley) %G%
.\"
.Dd
.Dt PRINTENV 1
.Os BSD 3
.Sh NAME
.Nm printenv , env
.Nd print out the environment, set and print environment
.Sh SYNOPSIS
.Nm printenv
.Op Ar name
.Nm env
.Op Fl
.Op Ar name=value ...
.Op Ar command
.Sh DESCRIPTION
.Nm Printenv
prints out the names and values of the variables in the environment,
with one name/value pair per line. If
.Ar name
is specified, only
its value is printed.
.Pp
If a
.Ar name
is specified and it is not defined in the environment,
.Nm printenv
returns exit status 1, else it returns status 0.
.Pp
.Nm Env
executes
.Ar command
after modifying the environment as
specified on the command line. The option
.Ar name=value
specifies
an environmental variable,
.Ar name ,
with a value of
.Ar value .
The option
.Sq Fl
causes
.Nm env
to completely ignore the environment
it inherits.
.Pp
If no command is specified,
.Nm env
prints out the names and values
of the variables in the environment, with one name/value pair per line.
.Sh SEE ALSO
.Xr csh 1 ,
.Xr sh 1 ,
.Xr execvp 3 ,
.Xr environ 7
.Sh HISTORY
The
.Nm printenv
command appeared in
.Bx 3.0 .
.Sh BUGS
.Nm Env
doesn't handle commands with equal (``='') signs in their
names, for obvious reasons.