Flylib.com

Books Software

 
 
 

Where To Get the Korn Shell

   

Korn Shell: Unix and Linux Programming Manual, Third Edition, The
By Anatole Olczak

Table of Contents
Chapter 1.  Introduction


Where To Get the Korn Shell

The Korn shell is included as an optional shell, along with the Bourne and C shells by most vendors, including Sun for Solaris, SCO for UnixWare, Hewlett-Packard for HP-UX, and others. It is also available as an unbundled product from many vendors .

The Desktop Korn shell ( dtksh ) is another version of the Korn shell that is available by many vendors as an upgrade to Kornshell88-based versions. It is usually located in /usr/dt/bin/dtksh .

The Public Domain Korn shell, or pdksh , as the name suggests, is a public domain version of the Korn shell. It's compatible with most any version of Unix, but is mostly used on Linux-based systems. At the time of this writing, the current version (5.2.14) has most of the Kornshell88, as well as some of the Kornshell93 and additional features that are not in either. For more detailed information, refer to Appendices F H.

David Korn and AT&T offer U/WIN, a non-commercial version of the Korn shell for Windows-based systems (NT and 98). It is based on KornShell98 and contains almost 200 of the popular Unix commands. We've included a version in the accompanying CD, but it is also available from http://www.research.att.com/sw/tools/uwin.

More information including links for the source distribution for the Korn Shell and U/Win is available at this URL: http://www.kornshell.com.

Mortice Kern Systems sells a version of the Korn shell for MS-DOS and Windows. There are also a number of shareware shells that have Korn shell-like functionality.


   
Top
 

   

Korn Shell: Unix and Linux Programming Manual, Third Edition, The
By Anatole Olczak

Table of Contents
Chapter 1.  Introduction


Which Version Do You Have?

To determine which version of the Korn shell you are using, run the following command:


$ print ${.sh.version}


Version 1993-12-28 i

If you don't get a version back from this command, then you are probably using an older version of the Korn shell. Try running the what command on the Korn shell binary (usually located in /bin/ksh ):


$ what /bin/ksh


Version  12/28/93


   
Top
 

   

Korn Shell: Unix and Linux Programming Manual, Third Edition, The
By Anatole Olczak

Table of Contents
Chapter 1.  Introduction


Logging In

A number of things happen before you see the login : prompt on your terminal. After you enter the login name , the login program is started. It finishes the process of logging you in by prompting for a password, checking the /etc/passwd file, and finally starting up your login shell. Your login shell is specified in the /etc/passwd file like this:


larissa:*:101:12::/home/larissa:/bin/sh


renata:*:102:101::/home/renata:/bin/ksh

For larissa , the login shell is /bin/sh , while for renata it is /bin/ksh .

Changing the Login Shell

To make the Korn shell your default login shell, have your system administrator change it to /bin/ksh or the pathname of wherever the Korn shell binary is located, or run the chsh command (if available on your system). Until that is done, you can still run the Korn shell by simply invoking:


$ ksh

This will give you a Korn subshell. To get back to your login shell, type Ctl-d ( Control-d ). If you get an error message complaining about ksh not being found, you can try to find it by executing:


$ find / name ksh print


/usr/local/bin/ksh

Once you've found it, add the directory in which it was found to your PATH variable. If you're using the Bourne shell, it would be done like this:


$ PATH=$PATH:/usr/local/bin


$ export PATH


$ ksh

while for the C shell:


% set path=($path /usr/local/bin)


% ksh

You could also invoke the Korn shell with the full pathname:


$ /usr/local/bin/ksh

More about the PATH variable is explained later in Chapter 7.


   
Top