Difference between revisions of "Ksh"

From ArchWiki
Jump to: navigation, search
(added minimalistic description of the link offered)
m (Installation)
(16 intermediate revisions by 6 users not shown)
Line 1: Line 1:
[[Category:Command shells (English)]]
+
[[Category:Command shells]]
 +
Korn Shell (ksh) is a standard/restricted command and programming language developed by AT&T.
 +
==Installation==
 +
The version from AT&T can be found on [https://aur.archlinux.org/packages.php?ID=13772 AUR].
  
 +
The [http://www.mirbsd.org/mksh.htm MirBSD™ Korn Shell] is another free implementation of the Korn Shell. It can be found in the community repo. Install with pacman:
 +
# pacman -S mksh
  
Korn Shell (ksh) is a standard/restricted command and programming language developed by AT&T.
+
The Public Domain Korn Shell is in the [https://aur.archlinux.org/packages/pdksh/ AUR].
 +
 
 +
==Making Ksh your default login shell==
 +
 
 +
Arch Linux init scripts use Bash. After the boot process is complete, the default login shell is user-specified. The chsh command can be used to change a user's default login shell without root access if the shell is listed in {{ic|/etc/shells}}. (If Ksh was installed using pacman, it should already have an entry in {{ic|/etc/shells}}). 
 +
 
 +
Grab the full path for Ksh using {{ic|/usr/bin/which}}:
 +
 
 +
$ which ksh
 +
 
 +
Which will probably output:
 +
 
 +
/bin/ksh
 +
 
 +
Change the default shell for the current user:
 +
 
 +
$ chsh -s /bin/ksh
 +
 
 +
'''Alternative as root, using usermod'''
 +
 
 +
Change the default shell using usermod:
 +
 
 +
# usermod -s /bin/ksh username
 +
 
 +
{{Note| The user needs to logout and log back in, to start using Ksh as their default shell.}}
 +
 
 +
After logging back in, verify that Ksh is the default shell with:
 +
 
 +
$ echo $SHELL
 +
 
 +
==Uninstallation==
 +
You must first change your default shell back to Bash before removing the Ksh package.
 +
 
 +
Change the default shell for the current user to bash:
 +
 
 +
$ chsh -s /bin/bash
 +
 
 +
'''Alternative as root, using usermod'''
 +
 
 +
Change the default shell using usermod:
 +
 
 +
# usermod -s /bin/bash username
 +
 
 +
Now you can safely remove the Ksh package:
 +
 +
# pacman -R pdksh
 +
 
 +
{{Warning| Failure to follow the above will result in all kinds of problems.}}
 +
 
 +
If you did not follow the above, you can still change the default shell back to Bash by editing {{ic|/etc/passwd}} as root.
 +
 
 +
For example:
 +
 +
from:
 +
username:x:1000:1000:Full Name,,,:/home/username:/bin/ksh
 +
to:
 +
username:x:1000:1000:Full Name,,,:/home/username:/bin/bash
 +
 
 +
==External Resources==
 +
[http://www.cs.mun.ca/~michael/pdksh/ pdksh official page]
 +
 
 +
[http://en.wikipedia.org/wiki/Korn_shell Korn Shell at Wikipedia]
 +
 
 +
[http://linux.die.net/man/1/pdksh pdksh man page at die.net]
  
The version from AT&T can be found on AUR (http://aur.archlinux.org/packages.php?ID=13772),
+
[http://kornshell.com/ Home Page For The KornShell Command And Programming Language]
but there is also a public domain implementation named "pdksh", which is in extra (http://www.archlinux.org/packages/extra/i686/pdksh/)
+
  
Some features are described here: http://bootiack.livejournal.com/294776.html
+
[http://www.openbsd.org/cgi-bin/man.cgi?query=ksh&sektion=1 pdksh man page at OpenBSD]

Revision as of 22:53, 24 December 2012

Korn Shell (ksh) is a standard/restricted command and programming language developed by AT&T.

Installation

The version from AT&T can be found on AUR.

The MirBSD™ Korn Shell is another free implementation of the Korn Shell. It can be found in the community repo. Install with pacman:

# pacman -S mksh

The Public Domain Korn Shell is in the AUR.

Making Ksh your default login shell

Arch Linux init scripts use Bash. After the boot process is complete, the default login shell is user-specified. The chsh command can be used to change a user's default login shell without root access if the shell is listed in /etc/shells. (If Ksh was installed using pacman, it should already have an entry in /etc/shells).

Grab the full path for Ksh using /usr/bin/which:

$ which ksh

Which will probably output:

/bin/ksh

Change the default shell for the current user:

$ chsh -s /bin/ksh

Alternative as root, using usermod

Change the default shell using usermod:

# usermod -s /bin/ksh username
Note: The user needs to logout and log back in, to start using Ksh as their default shell.

After logging back in, verify that Ksh is the default shell with:

$ echo $SHELL

Uninstallation

You must first change your default shell back to Bash before removing the Ksh package.

Change the default shell for the current user to bash:

$ chsh -s /bin/bash

Alternative as root, using usermod

Change the default shell using usermod:

# usermod -s /bin/bash username

Now you can safely remove the Ksh package:

# pacman -R pdksh
Warning: Failure to follow the above will result in all kinds of problems.

If you did not follow the above, you can still change the default shell back to Bash by editing /etc/passwd as root.

For example:

from:

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

to:

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

External Resources

pdksh official page

Korn Shell at Wikipedia

pdksh man page at die.net

Home Page For The KornShell Command And Programming Language

pdksh man page at OpenBSD