xref: /netbsd/usr.bin/env/env.1 (revision c4a72b64)
1.\"	$NetBSD: env.1,v 1.10 2002/09/30 11:08:59 grant Exp $
2.\"
3.\" Copyright (c) 1980, 1990 The Regents of the University of California.
4.\" All rights reserved.
5.\"
6.\" This code is derived from software contributed to Berkeley by
7.\" the Institute of Electrical and Electronics Engineers, Inc.
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\" 1. Redistributions of source code must retain the above copyright
12.\"    notice, this list of conditions and the following disclaimer.
13.\" 2. Redistributions in binary form must reproduce the above copyright
14.\"    notice, this list of conditions and the following disclaimer in the
15.\"    documentation and/or other materials provided with the distribution.
16.\" 3. All advertising materials mentioning features or use of this software
17.\"    must display the following acknowledgement:
18.\"	This product includes software developed by the University of
19.\"	California, Berkeley and its contributors.
20.\" 4. Neither the name of the University nor the names of its contributors
21.\"    may be used to endorse or promote products derived from this software
22.\"    without specific prior written permission.
23.\"
24.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
25.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34.\" SUCH DAMAGE.
35.\"
36.\"	from: @(#)printenv.1	6.7 (Berkeley) 7/28/91
37.\"	$NetBSD: env.1,v 1.10 2002/09/30 11:08:59 grant Exp $
38.\"
39.Dd August 27, 1993
40.Dt ENV 1
41.Os
42.Sh NAME
43.Nm env
44.Nd set and print environment
45.Sh SYNOPSIS
46.Nm
47.Op Fl i
48.Op Ar name=value ...
49.Oo
50.Ar utility
51.Op argument ...
52.Oc
53.Sh DESCRIPTION
54.Nm
55executes
56.Ar utility
57after modifying the environment as
58specified on the command line.
59The option
60.Ar name=value
61specifies
62an environmental variable,
63.Ar name  ,
64with a value of
65.Ar value  .
66The option
67.Sq Fl i
68causes
69.Nm
70to completely ignore the environment
71it inherits.
72.Pp
73If no
74.Ar utility
75is specified,
76.Nm
77prints out the names and values
78of the variables in the environment, with one
79.Ar name=value
80pair per line.
81.Sh EXIT STATUS
82If the
83.Ar utility
84is invoked, the exit status of
85.Nm
86shall be the exit status of
87.Ar utility ;
88otherwise, the
89.Nm
90utility exits with one of the following values:
91.Bl -tag -width Ds
92.It 0
93The
94.Nm
95utility completed successfully
96.It 1-125
97An error occurred in the
98.Nm
99utility.
100.It 126
101The utility specified by
102.Ar utility
103was found, but could not be invoked.
104.It 127
105The utility specified by
106.Ar utility
107could not be found.
108.El
109.Sh COMPATIBILITY
110The historic
111.Fl
112option has been deprecated but is still supported in this implementation.
113.Sh SEE ALSO
114.Xr execvp 3 ,
115.Xr environ 7
116.Sh STANDARDS
117The
118.Nm
119utility conforms to
120.St -p1003.2-92 .
121.Sh BUGS
122.Nm
123doesn't handle commands with equal
124.Pq Dq =
125signs in their
126names, for obvious reasons.
127