KornShell
Adapted from Wikipedia Β· Adventurer experience
What is KornShell?
KornShell (ksh) is a type of computer program called a Unix shell. It was created by David Korn at Bell Labs in the early 1980s. It was first shown to the public at USENIX on July 14, 1983. KornShell was built using the source code from another shell called the Bourne shell.
Development
Several other people at Bell Labs helped improve KornShell. Mike Veach and Pat Sullivan added special ways to move around and edit text. These ways were similar to two popular text editors called Emacs and vi. KornShell was designed to work like the Bourne shell, so anyone used to that could easily use KornShell. It also included useful features from another shell called the C shell, based on what users at Bell Labs wanted.
## Features
KornShell follows the [POSIX.2](/wiki/POSIX#POSIX.2) standard for shell and utilities. It has several features that make it different from the older Bourne shell. These include [job control](/wiki/Job_control_\(Unix\)), [command aliasing](/wiki/Alias_\(command\)), and [command history](/wiki/Command_history), which were inspired by the [C shell](/wiki/C_shell). Users can choose from three different ways to edit commands, similar to [vi](/wiki/Vi_\(text_editor\)), [Emacs](/wiki/Emacs), and [Gosling Emacs](/wiki/Gosling_Emacs).
KornShell also offers special types of variables and math functions. It supports advanced programming ideas like objects, where variables can act like small tools with their own features and actions. These features help make KornShell powerful and flexible for users.
## History
KornShell was first shared as part of AT&T's Experimental Toolchest in 1986 and later became part of [UNIX System V](/wiki/UNIX_System_V) Release 4 in 1989.
KornShell started as [proprietary software](/wiki/Proprietary_software). In 2000, its source code was released under a special AT&T license, and from the **ksh93q** release in early 2005, it used the [Eclipse Public License](/wiki/Eclipse_Public_License). KornShell is now part of the AT&T Software Technology Open Source Software Collection. Because it was once only available through AT&T, other free shells were made, such as pdksh, mksh, [Bash](/wiki/Bash_\(Unix_shell\)), and [Z shell](/wiki/Z_shell).
The original KornShell, called ksh88, helped shape the [POSIX.2](/wiki/POSIX#POSIX.2) standard for shells. Some companies still offer their own versions of ksh88, sometimes adding new features. The ksh93 version is kept up to date on [GitHub](/wiki/GitHub).
<figure class="inline-figure"><img src="https://upload.wikimedia.org/wikipedia/commons/thumb/5/5a/Korn_Shell_running_on_SUA.png/250px-Korn_Shell_running_on_SUA.png" data-caption="Korn Shell running on Windows Services for UNIX"><figcaption>Korn Shell running on Windows Services for UNIX</figcaption></figure>
As "Desktop KornShell" (dtksh), ksh93 is included with the [Common Desktop Environment](/wiki/Common_Desktop_Environment). This version adds special features for [Motif](/wiki/Motif_\(software\)) widgets. It was meant to compete with [Tcl](/wiki/Tcl_\(programming_language\))/[Tk](/wiki/Tk_\(software\)).
The original KornShell, ksh88, became the main shell on [AIX](/wiki/AIX) starting with version 4, while ksh93 was offered separately.
[UnixWare](/wiki/UnixWare) 7 includes both ksh88 and ksh93. The main Korn shell there is ksh93, found as /usr/bin/ksh, with the older version available as /usr/bin/ksh88. UnixWare also includes dtksh when [CDE](/wiki/Common_Desktop_Environment) is installed.
The **ksh93** version had some trouble after its creators left AT&T around 2012 at version **ksh93u+**. The main creators worked on a **ksh93v-** beta version until about 2014. This work was mostly taken on by [Red Hat](/wiki/Red_Hat) in 2017, leading to the first release of **ksh2020** in fall 2019. However, this release caused problems and was not kept updated by AT&T. In March 2020, AT&T decided to go back to **ksh93u+** and start again, putting the **ksh2020** changes aside. **ksh2020** was released as a big update for several reasons, like removing [EBCDIC](/wiki/EBCDIC) support, but it was never supported by AT&T. The **ksh2020** source code has not changed since February 2020 and was made read-only in October 2021.
Because of problems with the **ksh2020** version, a new space for **ksh93u+m** was made in May 2020, based on the last stable AT&T version (**ksh93u+** from August 1, 2012), where fixes are still being added.
## Primary contributions to the main software branch
The main version of KornShell (ksh) began in July 1983 and went on until the release of **KSH2020** in late 2019. After 2020, development split into different groups.
Many people helped make and improve KornShell. The main person was [David G. Korn](/wiki/David_Korn_\(computer_scientist\)), who worked at AT&T Bell Labs, AT&T Laboratories, and Google. Others who helped include Glenn S. Fowler, Kiem-Phong Vo, Adam Edgar, Michael T. Veach, Patrick D. Sullivan, Matthijs N. Melchior, and Karsten-Fleischer. Companies like [AT&T Bell Laboratories](/wiki/AT&T_Bell_Laboratories), [AT&T Network Systems International](/wiki/AT&T), [AT&T Laboratories (now AT&T Labs)](/wiki/AT&T_Labs), Omnium Software Engineering, [Oracle Corporation](/wiki/Oracle_Corporation), [Google](/wiki/Google), and [Red Hat](/wiki/Red_Hat) also helped a lot.
Some companies gave free tools and services to help build KornShell, including [Coverity](/wiki/Coverity), [GitHub](/wiki/GitHub), and [Travis CI](/wiki/Travis_CI).
## Variants
There are several versions and copies of KornShell:
- dtksh β a version of ksh93 that comes with [CDE](/wiki/Common_Desktop_Environment).
- tksh β a version of ksh93 that works with the [Tk](/wiki/Tk_\(software\)) [widget toolkit](/wiki/Widget_toolkit).
- oksh β a version of KornShell from [OpenBSD](/wiki/OpenBSD) made to work on many different operating systems. It was the default shell in DeLi Linux 7.2.
- loksh β a [Linux](/wiki/Linux) version of KornShell from [OpenBSD](/wiki/OpenBSD) with only small changes.
- mksh β a free version of the KornShell language, started from OpenBSD pdksh. It was first made for [MirOS BSD](/wiki/MirOS_BSD) and is used on BSD, Debian, and as the default shell on Android.
- SKsh β a version for [AmigaOS](/wiki/AmigaOS) that adds Amiga-specific features, like [ARexx](/wiki/ARexx) support. [MorphOS](/wiki/MorphOS) uses pdksh in its SDK.
- [MKS Inc.](/wiki/MKS_Inc.)'s MKS Korn shell β a special version of KornShell for [Microsoft Windows Services for UNIX](/wiki/Microsoft_Windows_Services_for_UNIX) up to version 2.0. In SFU version 3.0, [Microsoft](/wiki/Microsoft) changed this to a new shell that follows POSIX.2 rules as part of [Interix](/wiki/Interix).
- KornShell is also part of [UWIN](/wiki/UWIN), a Unix compatibility package made by David Korn.
- /bin/sh in Doug Gwyn's (US Army BRL) System V on BSD package included Ron Natalie's version of the SVR2 /bin/sh. This was a version that had both job control and command line editing. It was one of the earliest versions at a time when ksh was still inside AT&T. Later, this became the /bin/sh used on all CMU Mach-derived systems.
Related articles
This article is a child-friendly adaptation of the Wikipedia article on KornShell, available under CC BY-SA 4.0.
Images from Wikimedia Commons. Tap any image to view credits and license.
Safekipedia