I was investigating my options for controlling the new built-ins
with ksh-20120929, and I happened to notice some garbled output for the
-n option of the builtin command:

$ builtin --?
Usage: builtin [ options ] [pathname ...]
OPTIONS
  -d              Deletes each of the specified built-ins. Special built-ins
                  cannot be deleted.
  -f lib          On systems with dynamic linking, lib names a shared
library
                  to load and search for built-ins. Libraries are
searched for
                  in ../lib/ksh and ../lib on $PATH and in system dependent
                  library directories. The system dependent shared library
                  prefix and/or suffix may be omitted. Once a library is
                  loaded, its symbols become available for the current and
                  subsequent invocations of builtin. Multiple libraries
can be
                  specified with separate invocations of builtin.
Libraries are
                  searched in the reverse order in which they are specified.
  -n              Disable each of the specified built-ins. Special built-ins
                  cannot be disabled. If no built-ns are specifed,
display all
                  disabled built-ins.][l?List the library base name,
plugin YYYYMMDD version stamp, and full path for -flib on one line on
the standard output.
  -p              Causes the output to be in a form of builtin commands that
                  can be used as input to the shell to recreate the
current set
                  of builtins.
  -s              Display only the special built-ins.

A quick check of src/cmd/ksh93/data/builtins.c revealed an extra square
bracket at the end of the -n option. Removing the extra square bracket
not only fixed the garbled output, but it also made the -l option
functional. I've attached builtin.c.diff to apply the fix.

                    Terrence Doyle
--- src/cmd/ksh93/data/builtins.c.orig  2014-07-21 10:17:25.000000000 -0500
+++ src/cmd/ksh93/data/builtins.c       2014-12-20 17:52:20.000000000 -0600
@@ -437,7 +437,7 @@
     "specified with separate invocations of \bbuiltin\b. Libraries are "
     "searched in the reverse order in which they are specified.]"
 "[n?Disable each of the specified built-ins. Special built-ins cannot be "
-    "disabled.  If no built-ns are specifed, display all disabled built-ins.]]"
+    "disabled.  If no built-ns are specifed, display all disabled built-ins.]"
 "[l?List the library base name, plugin YYYYMMDD version stamp, and full "
     "path for \b-f\b\alib\a on one line on the standard output.]"
 "[p?Causes the output to be in a form of \bbuiltin\b commands that can be "
_______________________________________________
ast-users mailing list
ast-users@lists.research.att.com
http://lists.research.att.com/mailman/listinfo/ast-users

Reply via email to