xref: /original-bsd/usr.bin/printenv/printenv.1 (revision 6c8be42f)
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.5 (Berkeley) 03/14/91
7.\"
8.Vx
9.Vx
10.Dd
11.Dt PRINTENV 1
12.UC
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
65.Nm Printenv
66appeared in 3 BSD.
67.Sh BUGS
68.Nm Env
69doesn't handle commands with equal (``='') signs in their
70names, for obvious reasons.
71