Chapter 22. The Korn Shell

IN THIS CHAPTER

  • The Korn shell

  • Parts of the ksh93 shell

  • Scripting with the ksh93 shell

In exploring different Linux shells, no doubt sooner or later you'll run into the Korn shell. The Korn shell is popular in the Unix world, but not so much in the Linux world. The Korn shell offers an interesting mix of features from both the Bourne and C shell worlds. This chapter discusses the features of the Korn shell, and walks you through the most common version of the Korn shell, the ksh93 shell.

The Korn Shell History

The original Korn shell was developed by David Korn while working at AT&T Bell Labs in the 1980s. David developed the Korn shell (you can probably guess where its name comes from) to be a next-generation programming shell, incorporating the best features of the Bourne shell and the best features of the C shell. The Korn shell quickly became known as a programmer's shell. It supports advanced programming features missing from the Bourne and C shells, including associative arrays and floating-point arithmetic.

The original Korn shell was controlled by AT&T as a proprietary shell up until 2000. Since then it has been released as open source software.

There are two separate threads of the original Korn shell:

  • ksh88

  • ksh93

Most Korn shell implementations (including those found in Linux distributions) use the ksh93 shell. The exception is Sun Solaris. Sun uses a modified version of the ksh88 shell, which is somewhat different from the ksh93 shell. Because the Korn ...

Get Linux® Command Line and Shell Scripting Bible now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.