KornShell (ksh) is a Unix shell which was developed by David Korn at Bell Labs in the early 1980s and announced at USENIX on July 14, 1983.[1][2] The initial development was based on Bourne shell source code.[7] Other early contributors were Bell Labs developers Mike Veach and Pat Sullivan, who wrote the Emacs and vi-style line editing modes' code, respectively.[8] KornShell is backward-compatible with the Bourne shell and includes many features of the C shell, inspired by the requests of Bell Labs users.
Features
KornShell complies with POSIX.2, Shell and Utilities, Command Interpreter (IEEE Std 1003.2-1992.) Major differences between KornShell and the traditional Bourne shell include:
job control, command aliasing, and command history designed after the corresponding C shell features; job control was added to the Bourne Shell in 1989[9]
a choice of three command line editing styles based on vi, Emacs, and Gosling Emacs
associative arrays and built-in floating-point arithmetic operations (only available in the ksh93 version of KornShell)
dynamic search for functions
mathematical functions
process substitution and process redirection
C-language-like expressions
enhanced expression-oriented for and while loops
dynamic extensibility of (dynamically loaded) built-in commands (since ksh93)
reference variables
hierarchically nested variables
variables can have member functions associated with them
object-oriented-programming (since ksh93t)
variables can be objects with member (sub-)variables and member methods
object methods are called with the object variable name followed (after a dot character) by the method name
special object methods are called on: object initialization or assignment, object abandonment (unset)
composition and aggregation is available, as well as a form of inheritance
KSH(1) General Commands Manual KSH(1)
NAME
ksh, rksh, pfksh - KornShell, a standard/restricted command and
programming language
NOTE
Currently, rksh and pfksh are not available on Mac OS X / Darwin.
SYNOPSIS
ksh [ ±abcefhikmnoprstuvxBCDP ] [ -R file ] [ ±o option ] … [ - ] [
arg … ]
rksh [ ±abcefhikmnoprstuvxBCD ] [ -R file ] [ ±o option ] … [ - ] [
arg … ]
DESCRIPTION
Ksh is a command and programming language that executes commands read
from a terminal or a file. Rksh is a restricted version of the command
interpreter ksh; it is used to set up login names and execution
environments whose capabilities are more controlled than those of the
standard shell. Rpfksh is a profile shell version of the command
interpreter ksh; it is used to to execute commands with the attributes
specified by the user's profiles (see pfexec(1)). See Invocation below
for the meaning of arguments to the shell.
Definitions.
A metacharacter is one of the following characters:
; & ( ) ⎪ < new-line space tab
A blank is a tab or a space. An identifier is a sequence of letters,
digits, or underscores starting with a letter or underscore.
Identifiers are used as components of variable names. A vname is a
sequence of one or more identifiers separated by a . and optionally
preceded by a .. Vnames are used as function and variable names. A
word is a sequence of characters from the character set defined by the
: