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