Home
|
UNIX
|
Practical
Configure the KSH Shell
Which KSH version
KSH is a POSIX-compliant shell (IEEE POSIX 1003.2). Different versions are used,
- HP/UX : KSH88 in base system
- AIX : KSH88 (/bin/ksh) and ksh93 (/bin/ksh93). KSH88 recommended
- NetBSD : PDKSH in base system
- OpenBSD : PDKSH in base system
- FreeBSD : PDKSH in ports
- Solaris 10 : modified KSH93, it seems
- Mac OS X : ksh93 in darwinports
Define your ksh version,
set -o emacs
^V
on the ksh prompt, you should get in example,
- Redhat RHEL5 : Version M 1993-12-28 r
- Redhat RHEL4 : PD KSH v5.2.14 99/07/13.2
- HP/UX 11.00 : Version 11/16/88
- HP/UX 11.23 : Version M-11/16/88f
Emacs mode
In emacs mode, directory and filename completion works already,
ESC ESC
but we will see how to configure the TAB keyboard binding.
Some other common keybindings,
^E # End of line
^A # Beginning of line. Use ^Aa inside screen
^U # Clear line
^H # Backspace
^B # Character back
^F # Character forward
Note. when you got a freaked up shell you can always reset it by doing,
reset
Configuration
Note ~/.profile is read first, before ~/.kshrc
You can define an alternate kshrc by setting this inside your profile,
ENV=~/altkshrc; export ENV
References