ArticleslgStudy

computer science

KornShell

KornShell is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand KornShell rather than just read about it. In short: 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.

KornShell — main illustration
KornShell — illustration

Key takeaways

  • KornShell belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect KornShell to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of KornShell from memory before moving on to harder problems.

Reference excerpt

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.

Features 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:

job control, command aliasing, and command history designed after the corresponding C shell features; job control was added to the Bourne Shell in 1989 a choice of three command line editing styles based on vi, Emacs, and Gosling Emacs associative arrays and built-in floating-point arithmetic operations (only available in the ksh93 version of KornShell) dynamic search for functions mathematical functions process substitution and process redirection C-language-like expressions enhanced expression-oriented for and while loops dynamic extensibility of (dynamically loaded) built-in commands (since ksh93) reference variables hierarchically nested variables variables can have member functions associated with them object-oriented-programming (since ksh93t) variables can be objects with member (sub-)variables and member methods object methods are called with the object variable name followed (after a dot character) by the method name special object methods are called on: object initialization or assignment, object abandonment (unset) composition and aggregation is available, as well as a form of inheritance

History 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 last active years of att/ast 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.

Successor forks 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, 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.

… excerpt ends here. Continue reading the full article.

Illustrations

KornShell illustration
KornShell: Korn Shell running on Windows Services for UNIX
Korn Shell running on Windows Services for UNIX

Worked examples

Example 1 — a first encounter with KornShell

Start with the simplest possible case. Write down what KornShell claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to KornShell before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about KornShell ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of KornShell

In research
KornShell appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses KornShell in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
KornShell is common in secondary-school and first-year university syllabi. It links to neighbouring topics Cross-platform software, Free software programmed in C, Programming languages standardized by POSIX, so understanding it makes those chapters shorter.
In everyday life
Look for KornShell outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “KornShell” →

How to study KornShell in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what KornShell means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain KornShell out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is KornShell in simple terms?

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.

Why does KornShell matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study KornShell?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on KornShell.

Tags

  • Cross-platform software
  • Free software programmed in C
  • Programming languages standardized by POSIX
  • Scripting languages
  • Software that uses Meson
  • Unix shells

Keep exploring