Korn shell

Korn shell
Paradigm(s) imperative, pipeline
Appeared in 1983[1][2]
Designed by David Korn
Developer AT&T Bell Laboratories
Major implementations ksh88, ksh93, dtksh, tksh, pdksh, mksh, SKsh, MKS Korn shell
Influenced by Bourne shell, C shell
Influenced zsh, bash, Windows PowerShell
OS Cross-platform
License Common Public License (AT&T ksh), MirOS Licence (mksh), mostly Public Domain with some GPL (pdksh)
ksh
Stable release ksh93u / February 8, 2011; 12 months ago (2011-02-08)[3]
mksh
Stable release R40[4] / June 12, 2011; 8 months ago (2011-06-12)[5]
oksh
Stable release 0.4.1 / August 28, 2010; 17 months ago (2010-08-28)[6]

The Korn shell (ksh) is a Unix shell which was developed by David Korn (AT&T Bell Laboratories) in the early 1980s and announced at USENIX on July 14, 1983.[1][2] Other early contributors were AT&T Bell Labs developers Mike Veach, who wrote the emacs code, and Pat Sullivan, who wrote the vi code.[7] ksh 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.

Contents

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 particular 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.

The functionality of the original Korn Shell (known as ksh88 from the year of its introduction) was used as a basis for the POSIX shell standard.

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. ksh93 is still maintained by its author. Releases of ksh93 are versioned by appending a letter to the name; the current version is ksh93u (released 2011-02-08); the previous version was ksh93t+ (released 2009-05-01) following ksh93t (released 2008-06-24). Some intermediate bug-fix versions are released without changes to this version string.[8]

As "Desktop KornShell", dtksh, the ksh93 was distributed as part of the Common Desktop Environment with several Unix systems, including Solaris, AIX, and HP-UX.[9] This version also provide shell-level mappings for Motif widgets. It was intended as competitor to tcl/tk.[10]

Uses and 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 (MirBSD 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.[11] It will, however, track POSIX closely and implement many ksh93 and some bash or zsh extensions. It is available for many unix-like operating systems[12] and is a default shell of MirOS BSD, FreeWRT, MidnightBSD, Android-x86, Android 3.0 (Honeycomb) and possibly Android 4 (Ice Cream Sandwich).

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.[13][14]

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.[15] 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 only and Windows Server 2008.[16][17][18] It is the default shell (/bin/sh) for SUA.[19] The Korn shell is also included in UWIN, a separate Unix compatibility package created by Korn himself;[20] however, UWIN only explicitly support versions of Windows up to XP, included.

The original Korn shell (ksh88) is the default shell on AIX since AIX version 4.[21][22] with ksh93 available separately.[23]

See also

References

  1. ^ a b Ron Gomes (Jun 9 1983). "Toronto USENIX Conference Schedule (tentative)". net.usenix. (Web link). Retrieved Dec 29 2010. 
  2. ^ a b Guy Harris (Oct 10 1983). "csh question". net.flame. (Web link). Retrieved Dec 29 2010. 
  3. ^ http://www2.research.att.com/sw/download/release.2011-02-08.2010-08-26.html
  4. ^ http://freshmeat.net/projects/mksh
  5. ^ http://article.gmane.org/gmane.os.miros.cvs/23625
  6. ^ http://freshmeat.net/projects/oksh
  7. ^ Bolsky, Morris I.; Korn, David G. (1989). "Acknowledgements". The KornShell Command and Programming Language. Englewood Cliffs, NJ: Prentice Hall. pp. xii. ISBN 0-13-516972-0. 
  8. ^ http://www2.research.att.com/sw/download/notes.html
  9. ^ Bill Rosenblatt; Arnold Robbins (2002). Learning the Korn Shell (2 ed.). O'Reilly Media, Inc.. pp. viii–ix. ISBN 9780596001957. http://books.google.com/books?id=5nMCY272chUC&pg=PR8. 
  10. ^ J. Stephen Pendergrast (1995). Desktop KornShell graphical programming. Addison-Wesley. p. 359. ISBN 9780201633757. http://books.google.com/books?id=O6xQAAAAMAAJ. 
  11. ^ "mksh development". mirbsd.org. http://www.mirbsd.org/mksh_old.htm#contrib. Retrieved 2011-06-21. 
  12. ^ "mksh tested on various platforms". mirbsd.org. http://www.mirbsd.org/mksh_bld.htm. Retrieved 2011-06-21. 
  13. ^ "David Korn Tells All". Slashdot. http://slashdot.org/articles/01/02/06/2030205.shtml. Retrieved 2009-10-22. 
  14. ^ "Jerry Feldman — USENIX NT/LISA NT conference attendee". Lists.blu.org. http://lists.blu.org/pipermail/discuss/1998-August/002393.html. Retrieved 2009-10-22. 
  15. ^ "Windows Services for UNIX Version 3.0". Technet.microsoft.com. http://technet.microsoft.com/de-de/library/bb463204(en-us).aspx. Retrieved 2009-10-22. 
  16. ^ "Welcome to Subsystem for UNIX-based Applications". Technet2.microsoft.com. 2006-03-13. http://technet2.microsoft.com/WindowsServer/en/library/695ac415-d314-45df-b464-4c80ddc2b3bc1033.mspx?mfr=true. Retrieved 2009-10-22. 
  17. ^ "Download details: Utilities and SDK for Subsystem for UNIX-based Applications in Microsoft Windows Vista SP1/Windows Server 2008 RTM". Microsoft.com. http://www.microsoft.com/downloadS/details.aspx?FamilyID=93ff2201-325e-487f-a398-efde5758c47f&displaylang=en. Retrieved 2009-10-22. 
  18. ^ "Utilities and SDK for Subsystem for UNIX-based Applications in Microsoft Windows 7 and Windows Server 2008 R2". Microsoft.com. 2008-04-03. http://www.microsoft.com/downloads/en/details.aspx?FamilyID=dc03485b-629b-49a6-b5ef-18617d1a9804. Retrieved 2010-10-19. 
  19. ^ http://www.suacommunity.com/SUA_Tools_Env_Start.htm
  20. ^ Anatole Olczak (2001). The Korn shell: Unix and Linux programming manual. Addison-Wesley Professional. pp. 4. ISBN 9780201675238. http://books.google.com/books?id=dCIJv94vXUMC&pg=PA4. 
  21. ^ Casey Cannon; Scott Trent; Carolyn Jones (1999). Simply AIX 4.3. Prentice Hall PTR. p. 21. ISBN 9780130213440. 
  22. ^ http://publib.boulder.ibm.com/infocenter/aix/v6r1/index.jsp?topic=/com.ibm.aix.cmds/doc/aixcmds5/sh.htm
  23. ^ http://publib.boulder.ibm.com/infocenter/aix/v6r1/index.jsp?topic=/com.ibm.aix.baseadmn/doc/baseadmndita/korn_shell_enhanced.htm

Further reading

External links