This book covers the 1993 version of the Korn shell. A large amount of what's covered is unique to that shell; a subset of what is unique applies only to the recent versions available directly from AT&T. In order to make best use of the book, you should be using the 1993 Korn shell. Use the following sequence of instructions to determine what shell you currently have and whether the 1993 Korn shell exists on your system, and to make the 1993 Korn shell be your login shell.
Determine which shell you are using. The SHELL variable denotes your login shell. Log in to your system and type echo $SHELL at the prompt. You will see a response containing sh, csh, or ksh; these denote the Bourne, C, and Korn shells, respectively. (There's also a good chance that you're using a third-party shell such as bash or tcsh.) If the response is ksh, go to step 3. Otherwise, continue to step 2.
See if some version of ksh exists on your system in a standard directory. Type ksh. If that works (prints a $ prompt), you have a version of the Korn shell; proceed to step 3. Otherwise, proceed to step 5.
Check the version. Type echo ${.sh.version}. If that prints a version, you're all set; skip the rest of these instructions. Otherwise, continue to step 4.
You don't have the 1993 version of the Korn shell. To find out what version you do have, type the command set -o emacs, then press CTRL-V. This will tell you if you have the 1988 version or the Public Domain Korn shell. In either case, continue to step 5.
Type the command /usr/dt/bin/dtksh. If this gives you a $ prompt, you have the Desktop Korn Shell, which is based on an early version of ksh93. You may use this version; almost everything in this book will work. Go to step 7.
You need to download an executable version of ksh93 or download the source and build an executable from it. These tasks are described in Appendix C. It would be best to enlist the help of your system administrator for this step. Once you have a working ksh93, continue to step 7.
Install ksh93 as your login shell. There are two situations; pick the one appropriate to you:
If chsh doesn't exist or doesn't work, check the man page for passwd(1). Look for either the -e or -s options for updating your password file information. Use whatever is appropriate for your system to change your login shell.
If none of the above works, you can resort to editing the /etc/passwd file while logged in as root. If you have the vipw(8) command, you should use that to edit your password file. Otherwise, edit the file manually with your favorite text editor.
Copyright © 2003 O'Reilly & Associates. All rights reserved.