svn commit: r223281 - head/bin/sh

Jilles Tjoelker jilles at FreeBSD.org
Sat Jun 18 23:43:29 UTC 2011


Author: jilles
Date: Sat Jun 18 23:43:28 2011
New Revision: 223281
URL: http://svn.freebsd.org/changeset/base/223281

Log:
  sh: Add do-nothing -h option.
  
  POSIX requires a -h option to sh and set, to locate and remember utilities
  invoked by functions as they are defined. Given that this
  locate-and-remember process is optional elsewhere, it seems safe enough to
  make this option do nothing.
  
  POSIX does not specify a long name for this option. Follow ksh in calling it
  "trackall".

Modified:
  head/bin/sh/options.h
  head/bin/sh/sh.1

Modified: head/bin/sh/options.h
==============================================================================
--- head/bin/sh/options.h	Sat Jun 18 23:02:53 2011	(r223280)
+++ head/bin/sh/options.h	Sat Jun 18 23:43:28 2011	(r223281)
@@ -62,8 +62,9 @@ struct shparam {
 #define	privileged optlist[15].val
 #define	Tflag optlist[16].val
 #define	Pflag optlist[17].val
+#define	hflag optlist[18].val
 
-#define NOPTS	18
+#define NOPTS	19
 
 struct optent {
 	const char *name;
@@ -91,6 +92,7 @@ struct optent optlist[NOPTS] = {
 	{ "privileged",	'p',	0 },
 	{ "trapsasync",	'T',	0 },
 	{ "physical",	'P',	0 },
+	{ "trackall",	'h',	0 },
 };
 #else
 extern struct optent optlist[NOPTS];

Modified: head/bin/sh/sh.1
==============================================================================
--- head/bin/sh/sh.1	Sat Jun 18 23:02:53 2011	(r223280)
+++ head/bin/sh/sh.1	Sat Jun 18 23:43:28 2011	(r223281)
@@ -32,7 +32,7 @@
 .\"	from: @(#)sh.1	8.6 (Berkeley) 5/4/95
 .\" $FreeBSD$
 .\"
-.Dd June 17, 2011
+.Dd June 18, 2011
 .Dt SH 1
 .Os
 .Sh NAME
@@ -241,6 +241,10 @@ tested, all commands of the function are
 well.
 .It Fl f Li noglob
 Disable pathname expansion.
+.It Fl h Li trackall
+A do-nothing option for
+.Tn POSIX
+compliance.
 .It Fl I Li ignoreeof
 Ignore
 .Dv EOF Ap s


More information about the svn-src-all mailing list