The proliferation of the Korn shell has not stopped at the boundaries of UNIX-dom. Many programmers who got their initial experience on UNIX systems and subsequently crossed over into the PC world wished for a nice UNIX-like environment (especially when faced with the horrors of the MS-DOS command line!), so it's not surprising that several UNIX shell-style interfaces to small-computer operating systems have appeared, Korn shell emulations among them.
Shells that are called "Korn shell" exist for the Minix and Coherent operating systems, both of which are small, inexpensive UNIX-like systems for IBM PC-type machines. These shells are not very compatible with the 1988 UNIX Korn shell; they only have the most important Korn shell features, such as emacs and vi editing modes and shell functions.
But far better than that is the MKS Toolkit, available from Mortice Kern Systems, Inc. The Toolkit is actually a complete UNIX-like environment for MS-DOS (version 2.0 and later) and OS/2 (version 1.2 and later). In addition to its shell, it comes with a vi editor and many UNIX-style utilities, including major ones like awk, uucp, and make.
The MKS shell itself is very much compatible with the 1988 UNIX Korn shell, and it has a well-written manual. Its only real syntactic difference is that it doesn't support the Korn shell's condition test syntax; you must use the old Bourne shell syntax instead.
The few other differences are due to limitations in the underlying operating systems rather than the shell itself. Most importantly, MS-DOS does not support multitasking or file permissions, so the MS-DOS version supports none of the relevant Korn shell features. The OS/2 version doesn't support file permissions either.
Specifically, the MKS shell for MS-DOS does not support the following:
File permission: umask, newgrp. The option privileged has been renamed to protected to reflect the lack of suid permission. Some test conditions have different meanings, as shown in Table A-1.
|Operator||UNIX Test||MKS Toolkit Test|
|-g||setgid bit||System attribute|
|-k||sticky (save text) bit||Archive attribute|
|-u||setuid bit||Hidden attribute|
Environment variables that contain directory lists, such as PATH
and MAILPATH, should use semicolons (
;) instead of colons (
to separate directories, because colons are used in DOS and OS/2
|UNIX Filename||MKS Toolkit Filename|
Condition tests: -a (file existence) is renamed -e to avoid clashing with the -a operator (for logical "and") in the older test or [...] syntax. The > and < (lexicographic comparisons) aren't supported.
The MKS shell also supports a few features of its own. It uses $[...] (a la bash) as an alternative syntax for arithmetic expressions, and it includes a few invocation and set options that are related to the underlying operating system.
Many UNIX users who have moved to DOS PCs swear by the MKS Toolkit; it's inexpensive ($299 at this writing), and it makes MS-DOS into a reasonable environment for advanced users and software developers. The Toolkit is available through most dealers that sell software tools, or through MKS itself. For more information, contact MKS, 35 King St. North, Waterloo, Ontario, Canada N2J 2W9, or electronically as follows:
|Telephone||(800) 265-2797 (US & Canada)|
|Fax||(519) 884 8861|