Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 26 Aug 1999 06:10:03 -0700 (PDT)
From:      Sheldon Hearn <sheldonh@uunet.co.za>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: bin/13363: Patch to env(1) for Unix 98 compatability 
Message-ID:  <199908261310.GAA01635@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/13363; it has been noted by GNATS.

From: Sheldon Hearn <sheldonh@uunet.co.za>
To: James Howard <howardjp@wam.umd.edu>
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: bin/13363: Patch to env(1) for Unix 98 compatability 
Date: Thu, 26 Aug 1999 15:02:38 +0200

 On Wed, 25 Aug 1999 17:57:56 -0400, James Howard wrote:
 
 > -	while ((ch = getopt(argc, argv, "-")) != -1)
 > +	while ((ch = getopt(argc, argv, "i-")) != -1)		
 >  		switch(ch) {
 > +		case 'i':
 >  		case '-':
 
 You don't seem to have addressed the case disordering that Bruce
 commented on. :-)
 
 > +.It Fl i
 > +Equivalent to
 > +.Fl .
 
 This text begs the question "why?". I'd also suggest that the behaviour
 of the two options be described under -i, with - being declared the
 compatibility option. This should encourage people to use -i for
 portability. This is how the Single UNIX Spec does it. :-P
 
 Ciao,
 Sheldon.
 
 Index: usr.bin/printenv/printenv.1
 ===================================================================
 RCS file: /home/ncvs/src/usr.bin/printenv/printenv.1,v
 retrieving revision 1.3
 diff -u -d -r1.3 printenv.1
 --- printenv.1	1999/07/12 20:23:52	1.3
 +++ printenv.1	1999/08/26 13:02:02
 @@ -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 @@
  .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
 Index: usr.bin/env/env.c
 ===================================================================
 RCS file: /home/ncvs/src/usr.bin/env/env.c,v
 retrieving revision 1.4
 diff -u -d -r1.4 env.c
 --- env.c	1998/12/06 22:58:22	1.4
 +++ env.c	1999/08/26 12:57:34
 @@ -60,9 +60,10 @@
  	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 @@
  usage()
  {
  	(void)fprintf(stderr,
 -	    "usage: env [-] [name=value ...] [command]\n");
 +	    "usage: env [-] [-i] [name=value ...] [command]\n");
  	exit(1);
  }
 


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199908261310.GAA01635>