Difference between revisions of "Ksh"

From ArchWiki
Jump to: navigation, search
m (expand)
m (lifted skel from zsh page)
Line 3: Line 3:
  
 
Korn Shell (ksh) is a standard/restricted command and programming language developed by AT&T.
 
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 [http://aur.archlinux.org/packages.php?ID=13772 AUR]
  
The version from AT&T can be found on AUR (http://aur.archlinux.org/packages.php?ID=13772),
+
The [http://www.archlinux.org/packages/extra/i686/pdksh/ Public Domain Korn Shell] is in the extra repository.
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
+
Install with pacman:
===Making Ksh your default shell===
+
# pacman -S pdksh
 +
 
 +
==Making Ksh your default shell==
  
 
The chsh command can be used to change a user's default shell without root access if the shell is listed in {{Filename|/etc/shells}}. (If Ksh was installed using pacman, it should already have an entry in {{Filename|/etc/shells}}).   
 
The chsh command can be used to change a user's default shell without root access if the shell is listed in {{Filename|/etc/shells}}. (If Ksh was installed using pacman, it should already have an entry in {{Filename|/etc/shells}}).   
Line 26: Line 29:
 
'''Alternative as root, using usermod'''
 
'''Alternative as root, using usermod'''
  
Change the default shell for multiple users, using usermod:
+
Change the default shell using usermod:
  
 
  # usermod -s /bin/ksh username
 
  # usermod -s /bin/ksh username
Line 35: Line 38:
  
 
  $ echo $SHELL
 
  $ 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==
 +
http://bootiack.livejournal.com/294776.html

Revision as of 02:41, 23 February 2010


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 Public Domain Korn Shell is in the extra repository.

Install with pacman:

# pacman -S pdksh

Making Ksh your default shell

The chsh command can be used to change a user's default shell without root access if the shell is listed in Template:Filename. (If Ksh was installed using pacman, it should already have an entry in Template:Filename).

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

http://bootiack.livejournal.com/294776.html