KornShell
Adapted from Wikipedia Β· Discoverer experience
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 and was first shown to the public at USENIX on July 14, 1983. This program was built using the source code from another shell called the Bourne shell.
Several other people at Bell Labs helped make KornShell better. Mike Veach and Pat Sullivan added special ways to move around and edit text, similar to two popular text editors called Emacs and vi. KornShell was designed to work just like the Bourne shell, so anyone used to that could easily use KornShell. It also included many useful features from another shell called the C shell, based on what the users at Bell Labs wanted.
Features
KornShell follows the POSIX.2 standard for shell and utilities. It has several features that make it different from the older Bourne shell. These include job control, command aliasing, and command history, which were inspired by the C shell. Users can choose from three different ways to edit commands, similar to vi, Emacs, and 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 Release 4 in 1989.
KornShell started as 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. 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, and Z shell.
The original KornShell, called ksh88, helped shape the 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.
As "Desktop KornShell" (dtksh), ksh93 is included with the Common Desktop Environment. This version adds special features for Motif widgets. It was meant to compete with Tcl/Tk.
The original KornShell, ksh88, became the main shell on AIX starting with version 4, while ksh93 was offered separately.
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 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 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 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) started in July 1983 and continued until the release of KSH2020 in late 2019. After 2020, development split into different groups.
Many people helped create and improve KornShell over the years. The main person behind it was David G. Korn, 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, AT&T Network Systems International, AT&T Laboratories (now AT&T Labs), Omnium Software Engineering, Oracle Corporation, Google, and Red Hat also played big roles in its development.
Some companies gave free tools and services to help build KornShell, including Coverity, GitHub, and Travis CI.
Variants
There are several versions and copies of KornShell:
- dtksh β a version of ksh93 that comes with CDE.
- tksh β a version of ksh93 that works with the Tk widget toolkit.
- oksh β a version of KornShell from OpenBSD made to work on many different operating systems. It was the default shell in DeLi Linux 7.2.
- loksh β a Linux version of KornShell from OpenBSD with only small changes.
- mksh β a free version of the KornShell language, started from OpenBSD pdksh. It was first made for MirOS BSD and is used on BSD, Debian, and as the default shell on Android.
- SKsh β a version for AmigaOS that adds Amiga-specific features, like ARexx support. MorphOS uses pdksh in its SDK.
- MKS Inc.'s MKS Korn shell β a special version of KornShell for Microsoft Windows Services for UNIX up to version 2.0. In SFU version 3.0, Microsoft changed this to a new shell that follows POSIX.2 rules as part of Interix.
- KornShell is also part of 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