Hi Roland,

I've been pondering the below approach to the builtins.
Although I believe we can add builtins which are bound to
some non-standard pathname, such as /usr/ast/bin or /opt/ast/bin, I think
we need to be extra careful about adding builtins which duplicate
Solaris command names and binding them to standard Solaris directories,
such as /usr/bin, /bin, or /usr/xpg4/bin.

By adding these bindings, ksh93 users who have these binding
pathnames on their path will automatically be using the AST libcmd 
builtin version of that command, rather than the Solaris binary.

I can think of one case (and I'm not saying to fix this) where
the head command from AST libcmd behaves differently
than Solaris head.   Without careful analysis of each command, I don't 
think we can safely replace them for ksh93 users.

In the below patch, there are 36 builtins bound to pathnames which
duplicate Solaris commands.  Of those 36, 21 builtins are bound
to /usr/bin, /bin, and/or /usr/xpg4/bin.  

The original list of default /bin-bound builtins in ksh93 is only the
below 13,
 
/bin/basename
/bin/cat
/bin/chmod
/bin/cmp
/bin/cut
/bin/dirname
/bin/head
/bin/logname
/bin/mkdir
/bin/uname
/bin/wc

so I'm also not sure if there is good reason (other than adding
AST versions of commands into ksh93, for those who want them) 
for expanding the list to 36, as far as what a typical ksh93 user might expect.
But I think the expanded set of builtins is acceptable if they are
not bound to the standard Solaris paths.

Please remember that although these builtins will be in /usr/bin/ksh93 only,
the eventual plan is to replace /usr/bin/ksh and /usr/xpg4/bin/sh
with ksh93.  So when that happens, /usr/bin/ksh users and scripts will be
switched to using some 21 new builtins instead of the Solaris commands.
I can see having these builtins available as an option (if users add
/usr/ast/bin to their paths), but not as a default (because users will
already have /usr/bin on their paths).

sleep is already a builtin in ksh93 without any pathname bindings,
and the functionality is an extension of Solaris's sleep command,
so I think it is safe to just leave sleep as a builtin
with no pathname bindings.

My recommendation is that ksh93 initially include these builtins
bound only to /usr/ast/bin (or some other pathname which is not
standard for Solaris), and we revisit adding other binding after ksh93
is integrated.

        April

> X-Original-To: ksh93-integration-discuss at opensolaris.org
> Delivered-To: ksh93-integration-discuss at opensolaris.org
> Date: Sat, 20 May 2006 07:04:52 +0200
> From: Roland Mainz <roland.mainz at nrubsig.org>
> X-Accept-Language: en
> MIME-Version: 1.0
> To: ksh93-integration-discuss <ksh93-integration-discuss at opensolaris.org>
> X-ID: XLqkiaZAZeXVZXeLq2NOpSCYiVMb2NZbRVXCcpdJN7Z-8VWsAxL5gd at t-dialin.net
> X-TOI-MSGID: 0af5dfe6-e772-4557-b7f7-81b694431d7f
> Subject: [ksh93-integration-discuss] ksh93 builtins in Solaris - the patch...
> X-BeenThere: ksh93-integration-discuss at opensolaris.org
> X-Mailman-Version: 2.1.4
> List-Id: Korn Shell 93 integration/migration project discussion 
<ksh93-integration-discuss.opensolaris.org>
> List-Unsubscribe: 
<http://mail.opensolaris.org/mailman/listinfo/ksh93-integration-discuss>, 
<mailto:ksh93-integration-discuss-request at 
opensolaris.org?subject=unsubscribe>
> List-Archive: 
<http://mail.opensolaris.org/pipermail/ksh93-integration-discuss>
> List-Post: <mailto:ksh93-integration-discuss at opensolaris.org>
> List-Help: 
<mailto:ksh93-integration-discuss-request at opensolaris.org?subject=help>
> List-Subscribe: 
<http://mail.opensolaris.org/mailman/listinfo/ksh93-integration-discuss>, 
<mailto:ksh93-integration-discuss-request at opensolaris.org?subject=subscribe>
> 
> 
> 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;)


Reply via email to