David Korn continues to enhance the Korn shell at AT&T Bell Labs.
At this writing, a new release is in beta test-usually the
final step before a piece of software is released.
negotiations between AT&T and USL (now Novell UNIX Systems Group) over
distribution rights could very well postpone the new shell's
public release for a couple of years or more.
Nevertheless, the new Korn shell has significant enhancements
that make it worth looking forward to. These features are subject
to change between the
time of this writing and the new shell's public
release. Here are some highlights:
The ability to customize key bindings, as in
but applicable to
vi- as well as emacs-mode.
This is implemented
as another "fake signal" trap (on keystrokes), so
it's extremely flexible.
Many new customization variables and options.
A greatly expanded set of string operators, providing
substrings, substitutions, and other functionality.
An enhanced array variable facility that provides for
associative arrays, which can be addressed by their
contents rather than by indices.
Better prompt string customization capabilities
(with command substitution and arithmetic expression evaluation).
Floating point (real number) arithmetic.
loop in the style of the C
A new option to
that allows C language
-style output formatting.
The ability to add new built-in commands, on systems
that support dynamic loading (the
More user control over command lookup order,
as in the POSIX standard and
The ability to set timed "alarms" (with the ALRM signal).
Expanded debugging support through additional fake signal traps.
Online help for built-in commands through a standard
The next release is expected to be incompatible with
the 1988 Korn shell in a few ways, some of which are
necessary for POSIX compliance (refer to the section
on POSIX in this Appendix for more details):
command will never display tracked
aliases unless you specify the option
Functions defined with
(the syntax not used in this
book) will have weaker
POSIX-compliant semantics. However, functions defined
will remain the same.
Tilde expansion can take place inside
variable expressions, whereas in the 1988 Korn shell,
tildes in these expressions are treated literally.
will be a keyword, as it is in the POSIX standard.
Command substitution and arithmetic expression evaluation
(in addition to parameter expansion)
will be performed on the variables
when they are expanded. This will allow for more flexible
customization of prompt strings and environment files.
It also means that grave accents (
must be quoted to be taken literally.
Output of the built-in commands
will change so that any words containing
special characters are single-quoted-so that these commands'
output can be used directly for input.
A new expansion operator,
, is used to
delimit strings that conform to the ANSI C language standard
for character strings. In the 1988 Korn shell,
the dollar sign to be treated literally; in future releases,
it must be backslash-escaped.
will be a built-in command, as in POSIX.
Command lookup order will change so that built-in commands
will be treated as if they were installed in
will be found at the same time as
when the shell goes through your
The rules will also change to comply with the POSIX
standard that allows certain
built-in commands to take precedence over functions.
Signal traps will propagate to subshells (whether nested or shell
scripts invoked from shells) until the subshell issues a
command (on any signal). Currently, traps do
not propagate to subshells; see
The built-in variable
will be dropped;
exit statuses will reflect system call error numbers.
Finally, the following features are expected
eventually to become obsolete:
will be renamed
the built-in variable
will be renamed
set -o trackall
. Alias tracking will always be on.
This will always be off (see
Grave accents (
) for command substitution.
condition test will be renamed
to avoid clashing with the
operator (logical "and")
in the old
pattern-matching operator in
will be replaced by
for better syntactic alignment
with the C language.
The arithmetic comparisons