KornShell’s Bad Rap

There are a number of myths surrounding KornShell that give it a bad rap. A history that few know about just adds to the confusion.  Can you answer the following questions:

  1. The Bourne Again Shell (bash) has its origin in which shell?
  2. UNIX uses which version of KornShell?
  3. Linux uses which version of KornShell?
  4. Who owns the copyright to KornShell?

If you know the answers to these questions, you are a KornShell guru, who does not perpetuate the myths. If not, you need to read on so that you know the truth about KornShell.

David G Korn is the author and maintainer of KornShell, and he still works at AT&T Bell Laboratories. The official site for KornShell is http://www.kornshell.com. Although you may references to Korn shell, David Korn insists that the proper name is KornShell. While David Korn first released KornShell in 1982, the two main branches are KornShell 88 (ksh88) and KornShell 93 (ksh93).

In 1988, AT&T’s Unix System Laboratory released KornShell as part of UNIX System V, Release 4 (SVR4). All third party versions of SVR4 included this the 1988 version of KornShell. Shortly after the release of SVR4, AT&T sold its rights to UNIX to Novell, except for the rights to AST (AT&T Software Technology). KornShell happens to be part of the AST package. Thus, AT&T Bell Laboratories retained the rights to KornShell. Consequently, the standard version of KornShell on UNIX systems is ksh88.

Standards committees are slow, and POSIX is no exception. In the early 1990’s, POSIX finally releaseed the Shell Language Standard from IEEE POSIX 1003.2 Shell and Utilities Language Committee. David Korn then modified KornShell to comply with the POSIX standard and thus created ksh93. Until AT&T Bell Laboratories released the AST package under its own open source license on March 1, 2000, AST was a proprietary product. Only those companies that purchased the AST license distributed ksh93. Thus, IBM AIX has both /usr/bin/ksh (ksh88), and ksh93. Although their version is ksh93g.

One odd quirk to the above is dtksh (Desktop KornShell), which is the underlying shell for CDE (Common Desktop Environment). dtksh is actually derived from ksh93. Thus, anytime a UNIX system runs CDE, it has a version of ksh93 on the system. It is their, but never used as a shell outside of the CDE environment. tksh, which provides shell access to the TK widget toolkit, is also based on ksh93.

Since KornShell was a proprietary product until the year 2000, other open source shells came into being that mimiced KornShell. These shells include bash and zsh. Consequently, bash is more closely related to ksh93, than it is to Bourne Shell. It just so happens that both shells are Bourne Shell compatible.

With the release of version q of ksh93 in 2005, AT&T switched to the Common Public License. This opened the door for including KornShell as a standard part of the Linux distribution. Ignoring dtksh and tksh, UNIX shell programmer’s write for ksh88, while Linux shell programmers write for ksh93. One of the best ways to know the differences between ksh88, ksh93, and bash is to look at the bash FAQ. From the FAQ, you can see that bash is compatible with ksh93, and ksh93 has a few more features than bash.

What version of KornShell are you using. From the ksh command prompt, enter the command: set -o emacs. On older versions, you could just type CTRL-v. On newer versions, you need to type ESC and then CTRL-v.

pixelstats trackingpixel
  • Share/Bookmark

2 Comments »

  1. bill duncan Said,

    February 19, 2010 @ 7:53 pm

    Good piece of history bringing some memories back. While not in the same bloodline, a mention of the pdksh might have been thrown in as well (a little bit of Canadiana if I recall). It never became as popular as bash, but did an admirable job of emulating the real McCoy..

    Thanks!

  2. Bill Anderson Said,

    February 20, 2010 @ 5:51 am

    I only used pdksh a few times. I found that it was a good emulation of ksh88, as long as you didn’t take it to the extremes. One of its downfalls was the failure to implement the POSIX standard as did ksh93 and bash. With few exceptions, the UNIX releases never moved beyond ksh88, even after ksh93 moved into the public domain. The years it spent trapped in the ast package took its toll on the popularity of ksh93.

Leave a Comment