The KornShell is an open source, POSIX-compatible shell language from AT&T based upon the original Bourne shell. Make sure you know whether your ksh is ksh93 or a clone.
The KornShell was created by David Korn at AT&T. It was created at Bell Labs (then AT&T) as a logical successor to the Bourne shell as the UNIX command line interpreter and scripting language.
The KornShell is compatible in syntax with the original Bourne shell and adds several features, like an interactive command line editor, functions with local variables, and arithmetic.
History
The KornShell was originally distributed as part of the AT&T Toolchest in the early 80's.
There are many different versions of the KornShell, and it can make a difference to know what they are.
Ksh93 is currently at version [ksh93u+
] (For a long time it was distributed by AT&T, now it has moved to GitHub https://github.com/att/ast) and distributed under the Eclipse Public License as part of the AST (AT&T Software Tools) project staffed by David Korn and Glenn Fowler.
- Ksh93 precursor ksh88 was the last official version of the KornShell in the AT&T Toolchest.
- Mortice Kern Systems ported ksh88 to DOS/Windows, and adopted by Microsoft into its UNIX toolsuite for windows. Microsoft eventually shifted to Interix for its UNIX toolsuite.
- UNIX vendors incorporated ksh88 into their product and enhanced it (Sun Microsystems added internationalisation).
- pdksh was distributed for UNIX (like) systems, but missed some features of the original.
- mksh is the contemporary successor of pdksh; David Korn agreed it’s a good thing as long as it cannot be confused with the original ksh, so please add the mksh tag for questions related to it (it’s on-topic in most ksh-related places)
- ksh93 has been under development by the AST team since its inception, with roughly 1 major update per year. For a long time ksh93 was only available commercially, but eventually was open-sourced.
Features
The following list includes features of ksh88 and ksh93
- command line editing - vi or emacs mode
command line history - use vi/emacs/arrow keys to recall earlier commands
Functions
- local variables in functions
- arithmetic (( ... )) and $(( ... ))
- floating point arithmetic (since ksh93)
- builtin replacements for many standard unix commands
Standardization
The KornShell (ksh93) was at the basis of the POSIX sh standard, although not all ksh93 features are included, and some posix shell features are optional.