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