summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSheldon Hearn <sheldonh@FreeBSD.org>1999-08-27 08:59:32 +0000
committerSheldon Hearn <sheldonh@FreeBSD.org>1999-08-27 08:59:32 +0000
commit85ab7ba1e0e4e1e97bb70d4aef7710ec8bc55b3a (patch)
treeaa1a38ac972ac6e6e0a09d67f2e9aa44e87b9b82
parent43faa6dff6bc57597c53c7e8dfdeb4c1909a0f53 (diff)
downloadsrc-test2-85ab7ba1e0e4e1e97bb70d4aef7710ec8bc55b3a.tar.gz
src-test2-85ab7ba1e0e4e1e97bb70d4aef7710ec8bc55b3a.zip
Notes
-rw-r--r--usr.bin/env/env.c5
-rw-r--r--usr.bin/printenv/printenv.122
2 files changed, 19 insertions, 8 deletions
diff --git a/usr.bin/env/env.c b/usr.bin/env/env.c
index a5083fbc681e..42ec003abf26 100644
--- a/usr.bin/env/env.c
+++ b/usr.bin/env/env.c
@@ -60,9 +60,10 @@ main(argc, argv)
char *cleanenv[1];
int ch;
- while ((ch = getopt(argc, argv, "-")) != -1)
+ while ((ch = getopt(argc, argv, "-i")) != -1)
switch(ch) {
case '-':
+ case 'i':
environ = cleanenv;
cleanenv[0] = NULL;
break;
@@ -85,6 +86,6 @@ static void
usage()
{
(void)fprintf(stderr,
- "usage: env [-] [name=value ...] [command]\n");
+ "usage: env [-] [-i] [name=value ...] [command]\n");
exit(1);
}
diff --git a/usr.bin/printenv/printenv.1 b/usr.bin/printenv/printenv.1
index b1ceb5a7f174..d3f8a145d4e0 100644
--- a/usr.bin/printenv/printenv.1
+++ b/usr.bin/printenv/printenv.1
@@ -32,7 +32,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)printenv.1 8.1 (Berkeley) 6/6/93
-.\" $Id$
+.\" $Id: printenv.1,v 1.3 1999/07/12 20:23:52 nik Exp $
.\"
.Dd June 6, 1993
.Dt PRINTENV 1
@@ -45,6 +45,7 @@
.Op Ar name
.Nm env
.Op Fl
+.Op Fl i
.Op Ar name=value ...
.Op Ar command
.Sh DESCRIPTION
@@ -72,12 +73,21 @@ an environment variable,
.Ar name ,
with a value of
.Ar value .
-The option
-.Sq Fl
-causes
+.Pp
+The options are as follows:
+.Bl -tag -width indent
+.It Fl i
+Execute the
+.Ar command
+with only those environment values specified. The environment inherited
+by
.Nm env
-to completely ignore the environment
-it inherits.
+is ignored completely.
+.It Fl
+Identical to the
+.Fl i
+option, available for backward compatibility.
+.El
.Pp
If no command is specified,
.Nm env