From ParabolaWiki
Jump to: navigation, search
Type Command shell
Initial Release 1983
Developer David Korn
Written in C
License AT&T KornShell: Eclipse Public License
pdksh: Public domain with some ISC-like code
mksh: MirOS Licence
dtksh: Eclipse Public License with some
Website www.kornshell.org

The KornShell (ksh) is a standard/restricted command and programming language developed by AT&T. The initial development was based on Bourne shell source code. KornShell is backward-compatible with the Bourne shell and includes many features of the C shell, inspired by the requests of Bell Labs users.

1 Variants

There are several software products related to KornShell:

  • dtksh – a fork of ksh93 included as part of CDE.
  • tksh – a fork of ksh93 that provides access to the Tk widget toolkit.
  • oksh – a Linux-based fork of OpenBSD's flavour of KornShell.
  • mksh – a free implementation of the KornShell language, forked from pdksh. It was originally developed for MirOS BSD and is licensed under permissive (though not public domain) terms; specifically, the MirOS Licence. In addition to its usage on BSD, this variant has replaced pdksh on Debian, and is the default shell on Android.
  • SKsh – an AmigaOS flavour that provides several Amiga-specific features, such as ARexx interoperability.
  • MKS Inc.'s MKS Korn shell – a proprietary implementation of the KornShell language from Microsoft Windows Services for UNIX (SFU) up to version 2.0; according to David Korn, the MKS Korn shell was not fully compatible with KornShell in 1998.
  • KornShell is included in UWIN, a Unix compatibility package by David Korn.

2 Installation

First, install an implementation from the official repositories:

  • MirBSD™ Korn Shell — Enhanced version of the public domain ksh.
https://www.mirbsd.org/mksh.htm || mksh
http://www.kornshell.com/ || ksh

3 Configuration files

~/etc/ksh.kshrc int.
~/.kshrc int.
/etc/profile login
~/.profile login

4 Making m/ksh your default login shell

Change the default shell for the current user:

$ chsh -s /bin/mksh

5 Uninstallation

Change the default shell before removing the mksh package.

Warning: Failure to follow the below procedure may result in users no longer having access to a working shell.

Run following command:

$ chsh -s /bin/bash user

Use it for every user with m/ksh set as their login shell (including root if needed). When completed, the mksh package can be removed.

Alternatively, change the default shell back to Bash by editing /etc/passwd as root.

Warning: It is strongly recommended to use vipw when editing /etc/passwd as it helps prevent invalid entries and/or syntax errors.

For example, change the following:

username:x:1000:1000:Full Name,,,:/home/username:/bin/mksh

To this:

username:x:1000:1000:Full Name,,,:/home/username:/bin/bash

6 See Also

7 Acknowledgement

This wiki article is based on ArchWiki. We may have removed non-FSDG bits from it.
This wiki article is based on Wikipedia. We may have removed non-FSDG bits from it.