.\" Copyright (c) 1980, 1990 The Regents of the University of California. .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms are permitted provided .\" that: (1) source distributions retain this entire copyright notice and .\" comment, and (2) distributions including binaries display the following .\" acknowledgement: ``This product includes software developed by the .\" University of California, Berkeley and its contributors'' in the .\" documentation or other materials provided with the distribution and in .\" all advertising materials mentioning features or use of this software. .\" Neither the name of the University nor the names of its contributors may .\" be used to endorse or promote products derived from this software without .\" specific prior written permission. .\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED .\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. .\" .\" @(#)printenv.1 6.4 (Berkeley) 7/24/90 .\" .Dd July 24, 1990 .Dt PRINTENV 1 .UC .Sh NAME .Nm printenv , env .Nd print out the environment, set and print environment .Sh SYNOPSIS .Nm printenv .Op Ar name .Nm env .Op Fl .Op Ar name=value \&... .Op Ar command .Sh DESCRIPTION .Nm Printenv prints out the names and values of the variables in the environment, with one name/value pair per line. If .Ar name is specified, only its value is printed. .Pp If a .Ar name is specified and it is not defined in the environment, .Nm printenv returns exit status 1, else it returns status 0. .Pp .Nm Env executes .Ar command after modifying the environment as specified on the command line. The option .Ar name=value specifies an environmental variable, .Ar name , with a value of .Ar value . The option .Sq Fl causes .Nm env to completely ignore the environment it inherits. .Pp If no command is specified, .Nm env prints out the names and values of the variables in the environment, with one name/value pair per line. .Sh SEE ALSO .Xr csh 1 , .Xr sh 1 , .Xr execvp 3 , .Xr environ 7 .Sh HISTORY .Nm Printenv appeared in 3 BSD. .Sh BUGS .Nm Env doesn't handle commands with equal (``='') signs in their names, for obvious reasons.