Home | History | Annotate | Download | only in common
      1 .H 1 ksh93
      2 KSH-93 is the most recent version of the KornShell Language
      3 described in
      4 "The KornShell Command and Programming Language,"
      5 by Morris Bolsky and David Korn of AT&T Bell Laboratories, ISBN 0-13-182700-6.
      6 The KornShell is a shell programming language,
      7 which is upward compatible with "sh" (the Bourne Shell),
      8 and is intended to conform to the IEEE P1003.2/ISO 9945.2 Shell and
      9 Utilities standard.
     10 KSH-93 provides an enhanced programming environment in
     11 addition to the major command-entry features of the BSD
     12 shell "csh".  With KSH-93, medium-sized programming tasks can be
     13 performed at shell-level without a significant loss in performance.
     14 In addition, "sh" scripts can be run on KSH-93 without modification.
     15 .P
     16 The code should conform to the IEEE POSIX 1003.1 standard and to the
     17 proposed ANSI-C standard so that it should be portable to all
     18 such systems.  Like the previous version, KSH-88,
     19 it is designed to accept eight bit character sets
     20 transparently, thereby making it internationally compatible.
     21 It can support multi-byte characters sets with some characteristics
     22 of the character set given at run time.
     23 .P
     24 KSH-93 provides the following features, many of which were also inherent
     25 in KSH-88:
     26 .BL
     27 .LI
     28 Enhanced Command Re-entry Capability:  The KSH-93 history
     29 function records commands entered at any shell level and stores
     30 them, up to a user-specified limit, even after you log off.
     31 This allows you to re-enter long commands with a few keystrokes
     32 - even those commands you entered yesterday.
     33 The history file allows for eight bit characters in
     34 commands and supports essentially unlimited size histories.
     35 .LI
     36 In-line Editing: In "sh", the only way to fix mistyped
     37 commands is to backspace or retype the line. KSH-93 allows you
     38 to edit a command line using a choice of EMACS-TC or "vi"
     39 functions.
     40 You can use the in-line editors to complete filenames as
     41 you type them.
     42 You may also use this editing feature when entering
     43 command lines from your history file.
     44 A user can capture keystrokes and rebind keys to customize the
     45 editing interface.
     46 .LI
     47 Extended I/O Capabilities:  KSH-93 provides several I/O
     48 capabilities not available in "sh", including the ability to:
     49 .BL
     50 .LI
     51 specify a file descriptor for input and output
     52 .LI
     53 start up and run co-processes
     54 .LI
     55 produce a prompt at the terminal before a read
     56 .LI
     57 easily format and interpret responses to a menu
     58 .LI
     59 echo lines exactly as output without escape processing
     60 .LI
     61 format output using printf formats.
     62 .LI
     63 read and echo lines ending in "\e".
     64 .LE
     65 .LI
     66 Improved performance: KSH-93 executes many scripts faster
     67 than the System V Bourne shell. A major reason for this is
     68 that many of the standard utilities are built-in.
     69 To reduce the time to initiate a command, KSH-93 allows
     70 commands to be added as built-ins at run time
     71 on systems that support dynamic loading such as System V Release 4.
     72 .LI
     73 Arithmetic: KSH-93 allows you to do integer arithmetic in any
     74 base from two to sixty-four.  You can also do double
     75 precision floating point arithmetic.
     76 Almost the complete set of C language operators are available
     77 with the same syntax and precedence.
     78 Arithmetic expressions can be used to as an argument expansion 
     79 or as a separate command.
     80 In addition there is an arithmetic for command that works
     81 like the for statement in C.
     82 .LI
     83 Arrays: KSH-93 supports both indexed and associative arrays.
     84 The subscript for an indexed array is an arithmetic expression,
     85 whereas, the subscript for an associative array is a string.
     86 .LI
     87 Shell Functions and Aliases: Two mechanisms - functions and
     88 aliases - can be used to assign a user-selected identifier to
     89 an existing command or shell script.
     90 Functions allow local variables and provide scoping
     91 for exception handling.
     92 Functions can be searched for and loaded on first reference the
     93 way scripts are.
     94 .LI
     95 Substring Capabilities:  KSH-93 allows you to create a
     96 substring of any given string either by specifying the starting
     97 offset and length, or by stripping off leading
     98 or trailing substrings during parameter substitution.
     99 You can also specify attributes, such as upper and lower case,
    100 field width, and justification to shell variables.
    101 .LI
    102 More pattern matching capabilities:  KSH-93 allows you to specify
    103 extended regular expressions for file and string matches.
    104 .LI
    105 KSH-93 uses a hierarchal name space for variables.
    106 Compound variables can be defined and variables can
    107 be passed by reference.  In addition, each variable
    108 can have one or more disciplines associated with
    109 it to intercept assignments and references.
    110 .LI
    111 Improved debugging:  KSH-93 can generate line numbers on execution
    112 traces.  Also, I/O redirections are now traced.
    113 There is a DEBUG trap that gets evaluated before each command
    114 so that errors can be localized.
    115 .LI
    116 Job Control: On systems that support job control, including
    117 System V Release 4, KSH-93
    118 provides a job-control mechanism almost identical to that of
    119 the BSD "csh", version 4.1.
    120 This feature allows you
    121 to stop and restart programs, and to move programs between the
    122 foreground and the background.
    123 .LI
    124 Added security:
    125 KSH-93 can execute scripts which do not have read permission
    126 and scripts which have the setuid and/or setgid set when
    127 invoked by name, rather than as an argument to the shell.
    128 It is possible to log or control the execution of setuid and/or
    129 setgid scripts.
    130 The noclobber option prevents you from accidentally erasing
    131 a file by redirecting to an existing file.
    132 .LI
    133 KSH-93 can be extended by adding built-in commands at run time.
    134 In addition, KSH-93 can be used as a library that can
    135 be embedded into an application to allow scripting.
    136 .LE
    137 Documentation for KSH-93 consists of an "Introduction to KSH-93",
    138 "Compatibility with the Bourne Shell" and a manual page and a
    139 README file.  In addition, the "New KornShell Command and Programming
    140 Language," book is available from Prentice Hall.
    141 
    142