xref: /freebsd/usr.bin/printenv/printenv.1 (revision befd5c23b24ce51a64b5c9afe51a589b3d8d89da)
19b50d902SRodney W. Grimes.\" Copyright (c) 1980, 1990, 1993
29b50d902SRodney W. Grimes.\"	The Regents of the University of California.  All rights reserved.
39b50d902SRodney W. Grimes.\"
49b50d902SRodney W. Grimes.\" This code is derived from software contributed to Berkeley by
59b50d902SRodney W. Grimes.\" the Institute of Electrical and Electronics Engineers, Inc.
69b50d902SRodney W. Grimes.\" Redistribution and use in source and binary forms, with or without
79b50d902SRodney W. Grimes.\" modification, are permitted provided that the following conditions
89b50d902SRodney W. Grimes.\" are met:
99b50d902SRodney W. Grimes.\" 1. Redistributions of source code must retain the above copyright
109b50d902SRodney W. Grimes.\"    notice, this list of conditions and the following disclaimer.
119b50d902SRodney W. Grimes.\" 2. Redistributions in binary form must reproduce the above copyright
129b50d902SRodney W. Grimes.\"    notice, this list of conditions and the following disclaimer in the
139b50d902SRodney W. Grimes.\"    documentation and/or other materials provided with the distribution.
149b50d902SRodney W. Grimes.\" 3. All advertising materials mentioning features or use of this software
159b50d902SRodney W. Grimes.\"    must display the following acknowledgement:
169b50d902SRodney W. Grimes.\"	This product includes software developed by the University of
179b50d902SRodney W. Grimes.\"	California, Berkeley and its contributors.
189b50d902SRodney W. Grimes.\" 4. Neither the name of the University nor the names of its contributors
199b50d902SRodney W. Grimes.\"    may be used to endorse or promote products derived from this software
209b50d902SRodney W. Grimes.\"    without specific prior written permission.
219b50d902SRodney W. Grimes.\"
229b50d902SRodney W. Grimes.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
239b50d902SRodney W. Grimes.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
249b50d902SRodney W. Grimes.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
259b50d902SRodney W. Grimes.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
269b50d902SRodney W. Grimes.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
279b50d902SRodney W. Grimes.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
289b50d902SRodney W. Grimes.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
299b50d902SRodney W. Grimes.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
309b50d902SRodney W. Grimes.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
319b50d902SRodney W. Grimes.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
329b50d902SRodney W. Grimes.\" SUCH DAMAGE.
339b50d902SRodney W. Grimes.\"
349b50d902SRodney W. Grimes.\"	@(#)printenv.1	8.1 (Berkeley) 6/6/93
35c3aac50fSPeter Wemm.\" $FreeBSD$
369b50d902SRodney W. Grimes.\"
379b50d902SRodney W. Grimes.Dd June 6, 1993
389b50d902SRodney W. Grimes.Dt PRINTENV 1
399b50d902SRodney W. Grimes.Os BSD 3
409b50d902SRodney W. Grimes.Sh NAME
419b50d902SRodney W. Grimes.Nm printenv , env
429b50d902SRodney W. Grimes.Nd print out the environment, set and print environment
439b50d902SRodney W. Grimes.Sh SYNOPSIS
449b50d902SRodney W. Grimes.Nm printenv
459b50d902SRodney W. Grimes.Op Ar name
469b50d902SRodney W. Grimes.Nm env
479b50d902SRodney W. Grimes.Op Fl
4885ab7ba1SSheldon Hearn.Op Fl i
499b50d902SRodney W. Grimes.Op Ar name=value ...
509b50d902SRodney W. Grimes.Op Ar command
519b50d902SRodney W. Grimes.Sh DESCRIPTION
529b50d902SRodney W. Grimes.Nm Printenv
539b50d902SRodney W. Grimesprints out the names and values of the variables in the environment,
549b50d902SRodney W. Grimeswith one name/value pair per line.  If
559b50d902SRodney W. Grimes.Ar name
569b50d902SRodney W. Grimesis specified, only
579b50d902SRodney W. Grimesits value is printed.
589b50d902SRodney W. Grimes.Pp
599b50d902SRodney W. GrimesIf a
609b50d902SRodney W. Grimes.Ar name
619b50d902SRodney W. Grimesis specified and it is not defined in the environment,
629b50d902SRodney W. Grimes.Nm printenv
639b50d902SRodney W. Grimesreturns exit status 1, else it returns status 0.
649b50d902SRodney W. Grimes.Pp
65befd5c23SSheldon HearnSome shells may provide a builtin
66befd5c23SSheldon Hearn.Nm
67befd5c23SSheldon Hearncommand which is similar or identical to this utility.
68befd5c23SSheldon HearnConsult the
69befd5c23SSheldon Hearn.Xr builtin 1
70befd5c23SSheldon Hearnmanual page.
71befd5c23SSheldon Hearn.Pp
729b50d902SRodney W. Grimes.Nm Env
739b50d902SRodney W. Grimesexecutes
749b50d902SRodney W. Grimes.Ar command
759b50d902SRodney W. Grimesafter modifying the environment as
769b50d902SRodney W. Grimesspecified on the command line.  The option
779b50d902SRodney W. Grimes.Ar name=value
789b50d902SRodney W. Grimesspecifies
7943b70d78SPhilippe Charnieran environment variable,
809b50d902SRodney W. Grimes.Ar name  ,
819b50d902SRodney W. Grimeswith a value of
829b50d902SRodney W. Grimes.Ar value  .
8385ab7ba1SSheldon Hearn.Pp
8485ab7ba1SSheldon HearnThe options are as follows:
8585ab7ba1SSheldon Hearn.Bl -tag -width indent
8685ab7ba1SSheldon Hearn.It Fl i
8785ab7ba1SSheldon HearnExecute the
8885ab7ba1SSheldon Hearn.Ar command
8987faa07bSSheldon Hearnwith only those environment values specified.
9087faa07bSSheldon HearnThe environment inherited
9185ab7ba1SSheldon Hearnby
929b50d902SRodney W. Grimes.Nm env
9385ab7ba1SSheldon Hearnis ignored completely.
9485ab7ba1SSheldon Hearn.It Fl
9585ab7ba1SSheldon HearnIdentical to the
9685ab7ba1SSheldon Hearn.Fl i
9785ab7ba1SSheldon Hearnoption, available for backward compatibility.
9885ab7ba1SSheldon Hearn.El
999b50d902SRodney W. Grimes.Pp
1009b50d902SRodney W. GrimesIf no command is specified,
1019b50d902SRodney W. Grimes.Nm env
1029b50d902SRodney W. Grimesprints out the names and values
1039b50d902SRodney W. Grimesof the variables in the environment, with one name/value pair per line.
1049b50d902SRodney W. Grimes.Sh SEE ALSO
1059b50d902SRodney W. Grimes.Xr csh 1 ,
1069b50d902SRodney W. Grimes.Xr sh 1 ,
1079b50d902SRodney W. Grimes.Xr execvp 3 ,
1089b50d902SRodney W. Grimes.Xr environ 7
1099b50d902SRodney W. Grimes.Sh HISTORY
1109b50d902SRodney W. GrimesThe
1119b50d902SRodney W. Grimes.Nm printenv
1129b50d902SRodney W. Grimescommand appeared in
1139b50d902SRodney W. Grimes.Bx 3.0 .
1149b50d902SRodney W. Grimes.Sh BUGS
1159b50d902SRodney W. Grimes.Nm Env
1169b50d902SRodney W. Grimesdoesn't handle commands with equal (``='') signs in their
1179b50d902SRodney W. Grimesnames, for obvious reasons.
118