xref: /original-bsd/usr.bin/printenv/printenv.1 (revision 210ce081)
1.\" Copyright (c) 1980, 1990 The Regents of the University of California.
2.\" All rights reserved.
3.\"
4.\" %sccs.include.redist.man%
5.\"
6.\"     @(#)printenv.1	6.4 (Berkeley) 07/24/90
7.\"
8.Dd
9.Dt PRINTENV 1
10.UC
11.Sh NAME
12.Nm printenv , env
13.Nd print out the environment, set and print environment
14.Sh SYNOPSIS
15.Nm printenv
16.Op Ar name
17.Nm env
18.Op Fl
19.Op Ar name=value \&...
20.Op Ar command
21.Sh DESCRIPTION
22.Nm Printenv
23prints out the names and values of the variables in the environment,
24with one name/value pair per line.  If
25.Ar name
26is specified, only
27its value is printed.
28.Pp
29If a
30.Ar name
31is specified and it is not defined in the environment,
32.Nm printenv
33returns exit status 1, else it returns status 0.
34.Pp
35.Nm Env
36executes
37.Ar command
38after modifying the environment as
39specified on the command line.  The option
40.Ar name=value
41specifies
42an environmental variable,
43.Ar name  ,
44with a value of
45.Ar value  .
46The option
47.Sq Fl
48causes
49.Nm env
50to completely ignore the environment
51it inherits.
52.Pp
53If no command is specified,
54.Nm env
55prints out the names and values
56of the variables in the environment, with one name/value pair per line.
57.Sh SEE ALSO
58.Xr csh 1 ,
59.Xr sh 1 ,
60.Xr execvp 3 ,
61.Xr environ 7
62.Sh HISTORY
63.Nm Printenv
64appeared in 3 BSD.
65.Sh BUGS
66.Nm Env
67doesn't handle commands with equal (``='') signs in their
68names, for obvious reasons.
69