March 15, 2011, 8:19 p.m.
posted by venik
Invoking The Korn Shell Separately
If you would like to use the Korn shell, but keep your login shell the same, you can avoid conflicts between the two shells by putting all of your Korn shell environment and startup commands in the environment file. This is specified by the ENV variable, which could be set in your Bourne shell .profile file like this:
$ grep ENV $HOME/.profile ENV=$HOME/.kshrc
or in the C shell .login file:
$ grep ENV $HOME/.login setenv ENV $HOME/.kshrc
This way, when you invoke the Korn shell, it will know where to look and find the environment settings. Here are some basic commands that should be in the environment file:
$ cat $HOME/.kshrc SHELL=/usr/local/bin/ksh EDITOR=vi export SHELL EDITOR
The EDITOR variable specifies the editor to use for command-line editing. Here it is set to vi, but it can also be set to emacs or gmacs. This will be covered in detail later in Chapter 7.