Hi!
----
Attached is a patch ("ksh93_solaris_builtins001.diff.txt") which deals
with the ksh93 builtins and their compatibilty to the Solaris versions.
The patch splits the ksh93 builtins into three categories:
1. Builtins which conform to XPG4 are prefixed with /usr/xpg4/bin/
(which means they're picked if ${PATH} contains /usr/xpg4/bin and this
${PATH}-element is searched for this specfic command
)
2. Builtins which are compatible to the native Solaris commands are
prefixed with /usr/bin/ AND /bin/ (since /bin is a link to ./usr/bin,
this is needed as scripts sometimes use /bin or /usr/bin or both in
their ${PATH})
3. All ksh93 builtins are prefixed with /usr/ast/bin/ (see
http://mail.opensolaris.org/pipermail/ksh93-integration-discuss/2006-May/000345.html
why /usr/ast/bin was selected) to make them available this way
----
Bye,
Roland
--
__ . . __
(o.\ \/ /.o) roland.mainz at nrubsig.org
\__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer
/O /==\ O\ TEL +49 641 7950090
(;O/ \/ \O;)
-------------- next part --------------
Index: src/cmd/ksh/Makefile.com
===================================================================
--- src/cmd/ksh/Makefile.com (revision 247)
+++ src/cmd/ksh/Makefile.com (working copy)
@@ -43,6 +43,7 @@
-DKSHELL \
-DSHOPT_APPEND \
-DSHOPT_BRACEPAT \
+ -DSHOPT_CMDLIB_SOLARIS_BLTINS=1 \
-DSHOPT_CMDLIB_BLTIN=0 \
-DSHOPT_COMPOUND_ARRAY \
-DSHOPT_DYNAMIC \
Index: src/lib/libshell/common/data/solaris_cmdlist.h
===================================================================
--- src/lib/libshell/common/data/solaris_cmdlist.h (revision 0)
+++ src/lib/libshell/common/data/solaris_cmdlist.h (revision 0)
@@ -0,0 +1,104 @@
+/* List builtins for Solaris.
+ * The list here is partially autogenerated and partially hand-picked
+ * based on compatibilty with the native Solaris versions of these
+ * tools
+*/
+
+/* POSIX compatible commands */
+#define XPG6CMDLIST(f) { "/usr/xpg6/bin/" #f, NV_BLTIN|NV_NOFREE, bltin(f) },
+#define XPG4CMDLIST(f) { "/usr/xpg4/bin/" #f, NV_BLTIN|NV_NOFREE, bltin(f) },
+/* Commands which are 100% compatible with native Solaris versions (/bin is
+ * a softlink to ./usr/bin so both need to be listed here) */
+#define BINCMDLIST(f) { "/bin/" #f, NV_BLTIN|NV_NOFREE, bltin(f) },
+#define USRBINCMDLIST(f) { "/usr/bin/" #f, NV_BLTIN|NV_NOFREE, bltin(f) },
+/* Make all ksh93 builtins accessible when /usr/ast/bin was added to ${PATH} */
+#define ASTCMDLIST(f) { "/usr/ast/bin/" #f, NV_BLTIN|NV_NOFREE, bltin(f) },
+
+/* The following script was used to generate the table below:
+(echo "// Generated data, do not edit." ;
+ for i in \
+ basename cat chgrp chmod chown cmp comm cp cut date dirname expr fds \
+ fmt fold head id join ln logname mkdir mkfifo mv paste pathchk \
+ rev rm rmdir sleep stty tail tee tty uname uniq wc ; do
+ # all ksh93 builtin are XPG4 compilant
+ [ -x "/usr/xpg4/bin/$i" ] && printf "XPG4CMDLIST($i)\n"
+ # list all ksh93 builtins which are 100% compatible to the
+ # Solaris versions
+ (for j in \
+ cat chmod chown head mkdir rmdir sleep tee uniq wc \
+ ; do [ "$i" == "$j" ] && exit 0 ; done ; exit 1) &&
+ printf "BINCMDLIST($i)\nUSRBINCMDLIST($i)\n"
+ printf "ASTCMDLIST($i)\n"
+ done
+echo "// End-of-generated-data.")
+*/
+/* Generated data, do not edit. */
+XPG4CMDLIST(basename)
+ASTCMDLIST(basename)
+BINCMDLIST(cat)
+USRBINCMDLIST(cat)
+ASTCMDLIST(cat)
+XPG4CMDLIST(chgrp)
+ASTCMDLIST(chgrp)
+BINCMDLIST(chmod)
+USRBINCMDLIST(chmod)
+ASTCMDLIST(chmod)
+XPG4CMDLIST(chown)
+BINCMDLIST(chown)
+USRBINCMDLIST(chown)
+ASTCMDLIST(chown)
+ASTCMDLIST(cmp)
+ASTCMDLIST(comm)
+XPG4CMDLIST(cp)
+ASTCMDLIST(cp)
+ASTCMDLIST(cut)
+XPG4CMDLIST(date)
+ASTCMDLIST(date)
+ASTCMDLIST(dirname)
+XPG4CMDLIST(expr)
+ASTCMDLIST(expr)
+ASTCMDLIST(fds)
+ASTCMDLIST(fmt)
+ASTCMDLIST(fold)
+BINCMDLIST(head)
+USRBINCMDLIST(head)
+ASTCMDLIST(head)
+XPG4CMDLIST(id)
+ASTCMDLIST(id)
+ASTCMDLIST(join)
+XPG4CMDLIST(ln)
+ASTCMDLIST(ln)
+ASTCMDLIST(logname)
+BINCMDLIST(mkdir)
+USRBINCMDLIST(mkdir)
+ASTCMDLIST(mkdir)
+ASTCMDLIST(mkfifo)
+XPG4CMDLIST(mv)
+ASTCMDLIST(mv)
+ASTCMDLIST(paste)
+ASTCMDLIST(pathchk)
+ASTCMDLIST(rev)
+XPG4CMDLIST(rm)
+ASTCMDLIST(rm)
+BINCMDLIST(rmdir)
+USRBINCMDLIST(rmdir)
+ASTCMDLIST(rmdir)
+BINCMDLIST(sleep)
+USRBINCMDLIST(sleep)
+ASTCMDLIST(sleep)
+XPG4CMDLIST(stty)
+ASTCMDLIST(stty)
+XPG4CMDLIST(tail)
+ASTCMDLIST(tail)
+BINCMDLIST(tee)
+USRBINCMDLIST(tee)
+ASTCMDLIST(tee)
+ASTCMDLIST(tty)
+ASTCMDLIST(uname)
+BINCMDLIST(uniq)
+USRBINCMDLIST(uniq)
+ASTCMDLIST(uniq)
+BINCMDLIST(wc)
+USRBINCMDLIST(wc)
+ASTCMDLIST(wc)
+/* End-of-generated-data. */
Index: src/lib/libshell/common/data/builtins.c
===================================================================
--- src/lib/libshell/common/data/builtins.c (revision 243)
+++ src/lib/libshell/common/data/builtins.c (working copy)
@@ -120,7 +120,9 @@
"wait", NV_BLTIN|BLT_ENV|BLT_EXIT, bltin(wait),
"type", NV_BLTIN|BLT_ENV, bltin(whence),
"whence", NV_BLTIN|BLT_ENV, bltin(whence),
-#if SHOPT_CMDLIB_BLTIN
+#if SHOPT_CMDLIB_SOLARIS_BLTINS
+#include "solaris_cmdlist.h"
+#elif SHOPT_CMDLIB_BLTIN
#define Q(f) #f /* libpp cpp workaround -- fixed 2005-04-11 */
#define CMDLIST(f) BDIR Q(f), NV_BLTIN|NV_NOFREE, bltin(f),
#include <cmdlist.h>
Index: src/lib/libshell/Makefile.com
===================================================================
--- src/lib/libshell/Makefile.com (revision 247)
+++ src/lib/libshell/Makefile.com (working copy)
@@ -126,6 +126,7 @@
-DKSHELL \
-DSHOPT_APPEND \
-DSHOPT_BRACEPAT \
+ -DSHOPT_CMDLIB_SOLARIS_BLTINS=1 \
-DSHOPT_CMDLIB_BLTIN=0 \
-DSHOPT_COMPOUND_ARRAY \
-DSHOPT_DYNAMIC \