The fragmentation of the UNIX marketplace has had its advantages and
disadvantages. The advantages came mostly in the early days:
lack of standardization and proliferation among technically
savvy academics and professionals
contributed to a healthy "free market" for UNIX software, in which
several programs of the same type (e.g., shells, text editors,
system administration tools) would often compete for popularity.
The best programs would usually become the most widespread,
while inferior software tended to fade away.
But often there was no single "best" program in a given category,
so several would prevail.
This led to the current situation, where multiplicity of similar
software has led to confusion, lack of compatibility, and-most
unfortunate of all-UNIX' inability to capture as big a share of
the market as other operating platforms (MS-DOS, Microsoft Windows,
Novell NetWare, etc.).
The "shell" category has probably suffered in this way more than
any other type of software. As we said in the Preface and
Chapter 1, Korn Shell Basics
of this book, several shells are currently available; the differences
between them are often not all that great. We believe that the Korn
shell is the best of the most widely used shells, but other shells
certainly have their staunch adherents, so they aren't likely to
fade into obscurity for a while.
Therefore we felt it necessary to include information on
shells similar to the 1988 UNIX Korn shell. This Appendix
summarizes the differences between the latter and the following:
The standard Version 7 Bourne shell, as a kind of "baseline"
The IEEE POSIX 1003.2 shell Standard, to which the Korn
shell and other shells will adhere in the future
The Windowing Korn shell (
), a Korn shell with
enhancements for X Window System programming
, a widely-used public domain Korn shell
shell, which is another enhanced Bourne shell
with some C shell and Korn shell features
Korn shell workalikes on desktop PC platforms, including
the MKS Toolkit shell
We'll conclude this appendix with a look at the Korn
shell's future: the next release's expected features,
obsolescent features of the current shell, and other issues.
The Korn shell is almost completely backward-compatible
with the Bourne shell.
The only significant feature of the latter that
the Korn shell doesn't support is
(caret) as a synonym
for the pipe (|) character.
This is an archaic feature that
the Bourne shell includes for its own backward compatibility
with earlier shells. No modern UNIX version has any shell code
as a pipe.
To describe the differences between the Bourne shell
and the Korn shell, we'll go through each chapter of this book
and enumerate the features discussed in the chapter that the Bourne
Although some versions of the Bourne
shell exist that include a few Korn shell features,
we refer to the standard, Version 7 Bourne shell that has been
around for many years.
forms of the
) expansion; the
Chapter 2, Command-line Editing
All. (I.e., the Bourne shell doesn't support any of
the history and editing features discussed in
Chapter 3, Customizing Your Environment
options. The Bourne shell
supports the "abbreviations" listed in the "Options" table in
Appendix B, Reference Lists
Environment files aren't supported; neither is the
The following built-in variables aren't supported:
Some of these variables (e.g.,
are still used by other programs, like
and news readers.
Chapter 4, Basic Shell Programming
Functions; the whence command; pattern-matching variable operators (
); advanced (regular expression) wildcards-use the external command
Command substitution syntax is different: use the older
Chapter 5, Flow Control
Conditional tests use older syntax:
These are actually two forms of the same external command
The logical operators
Supported test operators differ from system to system.
construct isn't supported.
Chapter 6, Command-line Options and Typed Variables
Use the external command
but note that it doesn't really do the same thing.
Integer arithmetic isn't supported: use the external command
instead of the
For integer conditionals, use the old condition test syntax
and relational operators
, etc., instead of
Array variables and the
command are not supported.
Chapter 7, Input/Output and Command-line Processing
The following I/O redirectors are not supported:
isn't supported (use
None of the options to
Chapter 8, Process Handling
Job control-specifically, the
Job number notation with
commands only accept process IDs.
(reset trap to
the default for that signal).
only accepts signal
numbers, not logical names. Coroutines aren't supported.
Chapter 9, Debugging Shell Programs
The ERR and DEBUG fake signals. The EXIT fake signal
supported, as signal 0.
Chapter 10, Korn Shell Administration
command and privileged mode aren't supported.
The Bourne shell's restrictive counterpart,
inhibits assignment to