Jump to content

KornShell

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by 202.189.69.150 (talk) at 10:15, 19 October 2010 (→‎Variants). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Korn shell
Paradigmimperative, pipeline
Designed byDavid Korn
DeveloperAT&T Bell Laboratories
First appeared1982
OSCross-platform
LicenseCommon Public License (AT&T ksh), MirOS Licence (mksh), mostly Public Domain with some GPL (pdksh)
Websitekornshell.com
Major implementations
ksh88, ksh93, dtksh, tksh, pdksh, mksh, SKsh, MKS Korn shell
Influenced by
Bourne shell, C shell
Influenced
zsh, bash, Windows PowerShell

The Korn shell (ksh) is a Unix shell which was developed by David Korn (AT&T Bell Laboratories) in the early 1980s. It is backwards-compatible with the Bourne shell and includes many features of the C shell as well, such as a command history, which was inspired by the requests of Bell Labs users.

Design

The main advantage of ksh over the traditional Unix shell is in its use as a programming language. Since its conception, several features were gradually added, while maintaining strong backwards compatibility with the Bourne shell.

The ksh93 version supports associative arrays and built-in floating point arithmetic.

For interactive use, ksh provides the ability to edit the command line in a WYSIWYG fashion, by hitting the appropriate cursor-up or previous-line key-sequence to recall a previous command, and then edit the command as if the users were in edit line mode. Three modes are available, compatible with vi, emacs and XEmacs.

ksh aims to respect the Shell Language Standard (POSIX 1003.2 "Shell and Utilities Language Committee").

History

Until 2000, Korn Shell remained AT&T's proprietary software. Since then it has been open source software, originally under a license peculiar to AT&T but, since the 93q release in early 2005, it has been licensed under the Common Public License. Korn Shell is available as part of the AT&T Software Technology (AST) Open Source Software Collection. As ksh was initially only available through a proprietary license from AT&T, a number of free and open source alternatives were created. These include the public domain pdksh and its actively developed successor mksh, the Free Software Foundation's Bourne-Again-Shell bash, and zsh.

Although the ksh93 version added many improvements (associative arrays, floating point arithmetic, etc.), some vendors still ship their own version of the older ksh88 as /bin/ksh, sometimes with extensions (as of 2005 only Solaris and NCR UNIX (a.k.a. MP-RAS) ship ksh88, all other Unix vendors migrated to ksh93 and even Linux distributions started shipping ksh93).

Variants

There are also two modified versions of ksh93 which add features for manipulating the graphical user interface: dtksh which is part of CDE and tksh which provides access to the Tk widget toolkit.

mksh (MirOS BSD Korn Shell) is an actively developed, BSDish-licensed, flavour of ksh. It is a direct descendant from the OpenBSD's /bin/ksh and heir of pdksh. mksh development focuses on code portability, security fixes, UTF-8 support, and tries to avoid feature creep.[1] It is available for many unix-like operating systems[2] and is a default shell of MirBSD, FreeWRT, MidnightBSD, Android-x86 and possibly the not-yet-released Android Gingerbread.

oksh is a port of OpenBSD's /bin/ksh to GNU/Linux which only contains enough modifications so that the code can compile under a GNU/Linux system. It is used as the default shell in DeLi Linux

SKsh is an AmigaOS version, that offers several Amiga-specific features such as ARexx interoperability.

MKS Inc.'s MKS Korn shell is another proprietary ksh reimplementation. It was included with Microsoft's Services for Unix (SFU) up to version 2.0. According to David Korn, the MKS Korn shell was not fully compatible with his own Korn shell implementation in 1998.[3][4]

With the introduction of SFU Version 3.0, Microsoft has replaced the MKS Korn shell with a new and fully POSIX compliant Korn shell as part of the new native Interix subsystem technology.[5] It is supported on Windows NT 4.0 SP6a+, Windows 2000, Windows XP Professional and Windows Server 2003. It is also available in the Subsystem for UNIX-based Applications (SUA) of Windows Vista and 7 Enterprise and Ultimate Editions and Windows Server 2008.[6][7]

See also

References

  1. ^ "mksh development". Mirbsd.mirsolutions.de. Retrieved 2009-10-22.
  2. ^ "mksh tested on various platforms". Mirbsd.org. Retrieved 2009-10-22.
  3. ^ "David Korn Tells All". Slashdot. Retrieved 2009-10-22.
  4. ^ "Jerry Feldman — USENIX NT/LISA NT conference attendee". Lists.blu.org. Retrieved 2009-10-22.
  5. ^ "Windows Services for UNIX Version 3.0". Technet.microsoft.com. Retrieved 2009-10-22.
  6. ^ "Welcome to Subsystem for UNIX-based Applications". Technet2.microsoft.com. 2006-03-13. Retrieved 2009-10-22.
  7. ^ "Download details: Utilities and SDK for Subsystem for UNIX-based Applications in Microsoft Windows Vista SP1/Windows Server 2008 RTM". Microsoft.com. Retrieved 2009-10-22.

External links