Subject: Re: [ksh93-integration-discuss] Re: ksh88->ksh93 migration plan
--------
Mike Kupfer <kupfer at athyra.sfbay.sun.com> wrote
> (I'm catching up on some old mail, including the private discussions
> before Roland created the ksh93-integration project.)
>
> >>>>> "Bill" == Bill Sommerfeld <sommerfeld at sun.com> writes:
>
> Bill> as I see it, the most crucial part of this proposal is an accurate
> Bill> enumeration of all the areas in which the two shells differ, an
> Bill> honest guess as to what fraction of scripts are affected, and an
> Bill> estimate of the degree of difficulty of repairing such scripts.
>
> One of the things Roland suggested was creating /usr/bin/oksh. Anyone
> who is unsure about the ksh93 compatibility of their scripts, or who
> knows they need ksh88, could change their scripts to use oksh instead of
> ksh.
>
> This seems pretty straightforward, particularly if we provide a tool to
> help.
>
> mike
> _______________________________________________
One of the most challenging issues facing migration from ksh88 to ksh93 is
compatibility. The question is what should it be compatible with:
1. ksh88.
2. Posix.
3. Previous versions of ksh93.
4. Other shells such as bash and zsh.
I have chosen to make the default mode for ksh93 to be very
nearly POSIX conforming. In addition, ksh93 tries to
follow the description in the "New KornShell Command and Programming
Language" book. When any issue comes up, I first look to both
of these for guidance. Given the above two contraints, I try
to make ksh93 compatible to ksh88 so as many ksh88 scripts as
possible will run without change.
Extensions to ksh93 that will not affect a script covered by
POSIX or New KornShell, are fair game. I have published most
of the ksh93 changes before they were released so that shells
like bash and zsh could add them if they wanted. The aim was
to keep the shells from diverging. I set up a small shell developers
group for this purpose and issues relating to compatibility
of the shells is discussed. In a few cases, ksh93, has picked
up features from zsh and bash. I am considering adding a bash
mode to ksh93 so that it will run bash scripts without change
and work like bash interactively when enabled.
I think that the biggest problems in moving from ksh88 to ksh93
are caused by changes dictated by POSIX and by documented changes that
I made for ksh93. Many of these incompatibilities can be discovered
by running ksh -n on a ksh88 script.
I am surprised the as many as 5% of the scripts in Solaris require
change to run under ksh93. I would like to understand why.
It might be possible to make changes to ksh93 to reduce this
substantially without breaking existing ksh93 scripts.
I would hope to get this number down to 1% or less.
While it is easy to change
#! /usr/bin/ksh
to
#! /usr/bin/oksh
to fix up an old script, the goal should be the elimination of oksh
and this will not be possible unless this is easy to do so I would
like to understand the issues.
David Korn
dgk at research.att.com