| KornShell | |
|---|---|
Interaction with OpenBSD's default shell, pdksh | |
| Original author | David Korn |
| Release | 1983 |
| Final release | 93u+
/ August 1, 2012 |
| Preview release | 93v-
/ December 24, 2014 |
| Written in | C |
| Operating system | Unix and Unix-like (e.g. Linux and macOS; also works in Windows 10) |
| Available in | English |
| Type | Unix shell |
| License |
|
| Website | kornshell |
| Repository | github |
| ksh2020 | |
|---|---|
| Developers | Kurtis Rader, Siteshwar Vashisht, community |
| Final release | 2020
/ October 10, 2019 |
| Predecessor | 93v- |
| License | Eclipse Public License |
| Website | kornshell |
| Repository | github |
| ksh93u+m | |
|---|---|
| Developers | Martijn Dekker, Johnothan King, hyenias |
| Stable release | 1.0.10
/ August 2, 2024 |
| Predecessor | 93u+ |
| License | Eclipse Public License |
| Website | github |
| Repository | github |
KornShell (ksh) is a Unix shell which was developed by David Korn at Bell Labs in the early 1980s and announced at USENIX on July 14, 1983. The initial development was based on Bourne shell source code. Other early contributors were Bell Labs developers Mike Veach and Pat Sullivan, who wrote the Emacs and vi-style line editing modes' code, respectively. KornShell is backward-compatible with the Bourne shell and includes many features of the C shell, inspired by the requests of Bell Labs users.
KornShell complies with POSIX.2, Shell and Utilities, Command Interpreter (IEEE Std 1003.2-1992). Major differences between KornShell and the traditional Bourne shell include:
KornShell was initially distributed as part of AT&T's Experimental Toolchest, in 1986, and was later included in UNIX System V Release 4, in 1989.

KornShell was originally proprietary software. In 2000 the source code was released under a license particular to AT&T, but since the ksh93q release in early 2005 it has been licensed under the Eclipse Public License. KornShell is available as part of the AT&T Software Technology (AST) Open Source Software Collection. As KornShell was initially only available through a proprietary license from AT&T, a number of free and open source alternatives were created. These include pdksh, mksh, Bash, and Z shell.
The functionality of the original KornShell, ksh88, was used as a basis for the standard POSIX.2, Shell and Utilities, Command Interpreter (IEEE Std 1003.2-1992).
Some vendors still ship their own versions of the older ksh88 variant, sometimes with extensions. ksh93 is maintained on GitHub, originally in att/ast ("AT&T Software Technology"), since moved to ksh93/ksh.
As "Desktop KornShell" (dtksh), ksh93 is distributed as part of the Common Desktop Environment. This version also provides shell-level mappings for Motif widgets. It was intended as a competitor to Tcl/Tk.
The original KornShell, ksh88, became the default shell on AIX in version 4, with ksh93 being available separately.
UnixWare 7 includes both ksh88 and ksh93. The default Korn shell is ksh93, which is supplied as /usr/bin/ksh, and the older version is available as /usr/bin/ksh88. UnixWare also includes dtksh when CDE is installed.
The ksh93 distribution underwent a less stable fate after the authors left AT&T around 2012, the final release being ksh93u+ 2012-08-01.
The primary authors of ksh continued working on a ksh93v- beta branch as "community members" of the att/ast GitHub repository until around 2014.
At the request of its customers, Red Hat took up maintenance of ksh93v- in 2017 in the same AT&T-owned repository and released an initial version of ksh2020 in the fall of 2019.
This release contained fixes for many issues and dropped many functions the authors found unnecessary (some having been deprecated before) such as EBCDIC support and broken math functions; accordingly, it was marked a "major release". Unfortunately it also introduced unintended crashes due to incompatibilities with previously-working scripts.
The changes in ksh2020 proved too sudden for ksh users, which were surprised by the incompatible changes after 26 years of minor maintenance, and to AT&T, which was flooded with bug reports referring to a software version they have never released but was nevertheless in their software repository. In March 2020, AT&T decided to roll back the community changes, stash them in a branch, and restart from ksh93u+: the explanation was that AST (AT&T Software Technology) was intended to only be a repository in maintenance mode, containing all sorts of AT&T code, not the ksh-focused repository Red Hat had turned it into.
Following this decision, att/ast had its "default branch" changed back to one that contained ksh93u+. Between February 2020 and June 2025 (when the repository was archived [made read-only]), a total of 13 commits were written to the repository. The last commit occurred in June 2020.
The ksh2020 code was moved to a repository called ksh2020/ksh, but no further commits were written after February 2020. It was archived in October 2021.
In May 2020, Martijn Dekker (McDutchie) forked att/ast, which contained ksh93u+ 2012-08-01, into ksh93/ksh. The README.md called the new project ksh93u+m and made a commitment to stability (without "bug compatibility"). As of August 2026[update], the last commit dates to April 2026.
Between 2017 and 2020 there was an ultimately unsuccessful attempt to breathe new life into the KornShell by extensively refactoring the last unstable AST beta version (93v-). While that ksh2020 effort is now abandoned and still has many critical bugs, it also had a lot of bugs fixed. More importantly, the AST issue tracker now contains a lot of documentation on how to fix those bugs, which made it possible to backport many of them to the last stable release instead. This ksh 93u+m reboot now incorporates many of these bugfixes, plus patches from OpenSUSE, Red Hat, and Solaris, as well as many new fixes from the community. Though there are many bugs left to fix, we are confident at this point that 93u+m is already the least buggy version of ksh93 ever released. As of late 2021, distributions such as Debian and Slackware have begun to package it as their default version of ksh93.
— Martijn Dekker, "README: Why?", ksh93/ksh (2021)
For the purposes of the lists below, the main software branch of KSH is defined as the original program, dating from July 1983, up and through the release of KSH2020 in late 2019. Continuing development of follow-on versions (branches) of KSH have split into different groups starting in 2020 and are not elaborated on below.
The following are listed in a roughly ascending chronological order of their contributions:
The following are listed in a roughly ascending chronological order of their contributions:
Besides the primary major contributing corporations (listed above), some companies have contributed free resources to the development of KSH. These are listed below (alphabetically ordered):
There are a few forks of KornShell:
There are many clones of KornShell:
The language extensions pioneered by ksh have also been adopted into other Bourne-compatible shells:
Instead of inventing a new script language, we built a form entry system by modifying the Bourne shell, adding built-in commands as necessary.
Note: ksh2020 is not maintained or supported
... The Berkeley job control was an interesting hack. For us at BRL the problem was I absolutely detested the C shell syntax. The Korn shell hadn't escaped from AT&T yet, so, I spent time figuring out how that really worked in the C shell (not really well documented), mostly by inspection, and then reimplemented it in the Bourne Shell (we were using the System V source code version for that). I still couldn't get traction at BRL for using the Bourne shell because by that time, tcsh had come out with command line editing. So back to the shell sources I went. By this time, 5R2 had come out so I grabbed the shell source form[sic] that. [...] I reworked emacs-ish command line editing into the shell. Subsequently, I had a nice conversation with David Korn at USENIX, being probably at that point the two most familiar with Bourne shell job control internals. I also sat down with the guys writing either bash or the pdksh (can't remember which) and explained all how this work[sic]. ... Years later I, had left the BRL, spent three years as a Rutgers administrator and was working for a small startup in Virginia. There was a MIPS workstation there. I was slogging along using ed... Not thinking about it, I attempted to retrieve a backgrounded job by typing "fg." To my surprise the shell printed "Job control not enabled." Hmm, I say. That sounds like my error message. "set -J" I type. "Job control enabled." Hey! This is my shell. Turns out Doug Gwyn put my mods into his "System V on BSD" distribution tape and it had made its way into the Mach code base and so every Mach-derived system ended up with it.