Home | History | Annotate | only in /onnv/onnv-gate/usr/src/lib/libshell/common
Up to higher level directory
NameDateSize
bltins/28-Oct-2009
builtins.mm08-Dec-200822.6K
COMPATIBILITY27-Dec-20085.5K
data/28-Oct-2009
DESIGN27-Dec-20087.2K
edit/28-Oct-2009
features/28-Oct-2009
fun/27-Dec-2008
include/28-Oct-2009
llib-lshell27-Dec-20081K
nval.327-Dec-200827.2K
OBSOLETE08-Dec-20082.9K
PROMO.mm27-Dec-20085.7K
README27-Dec-200811.3K
RELEASE28-Oct-2009120.2K
RELEASE8808-Dec-200819.5K
RELEASE9308-Dec-200821.8K
scripts/28-Oct-2009
sh/28-Oct-2009
sh.128-Oct-2009166.1K
sh.memo08-Dec-200894K
shell.327-Dec-200815K
tests/28-Oct-2009
TYPES27-Dec-20087.2K

README

      1 This directory, and its subdirectories contain the source code
      2 for ksh-93; the language described in the second addition of
      3 the book, "The KornShell Command and Programming Language," by
      4 Morris Bolsky and David Korn which is published by Prentice Hall.
      5 ksh-93 has been compiled and run on several machines with several
      6 operating systems.  The end of this file contains a partial list of
      7 operating systems and machines that ksh-93 has been known to run on.
      8 
      9 The layout of files for ksh-93 has changed somewhat since ksh-88,
     10 the last major release.  Most of the source code for ksh remains in
     11 the sh directory.  However, the shell editing and history routines
     12 are in the edit sub-directory.  The code for shell built-ins is
     13 in the bltins directory.  The data directory contains read-only
     14 data tables and messages that are used by the shell.  The include
     15 files remain in the include directory and the shlib directory
     16 is gone.  The features directory replaces the older install
     17 directory. The method for generating systems specific feature
     18 information has changed substantially.
     19 
     20 The Makefile file contains several compilation options that can be set
     21 before compiling ksh.  Options are of the form SHOPT_option and become
     22 #define inside the code.  These options are set to their recommended
     23 value and some of these may disappear as options in future releases.
     24 A value of 0, or no value  represents off, 1 represents on.
     25 Note that == is needed, not =, because these are nmake state variables
     26 and changing their value will cause all modules that could be affected
     27 by this change to be recompiled.
     28 The options have the following defaults and meanings:
     29     ACCT         off Shell accounting.
     30     ACCTFILE     off Enable per user accounting info.
     31     AUDIT	 off For auditing specific users
     32     AUDITFILE	 "/etc/ksh_audit"
     33     APPEND       on  Allows var+=val string and array append.
     34     BASH         off Bash compatibility mode.  It is not fully implemented
     35                      and is experimental.
     36     BRACEPAT     on  C-shell type abc{d,e}f style file generation
     37     CMDLIB_BLTIN off Makes all commands in libcmd.a builtins.  The
     38                      SH_CMDLIB_DIR nmake state variable can be used to
     39 		     specify a directory. 
     40     CMDLIB_DIR   off Sets CMDLIB_BLTIN=1 and provides a default value
     41                      of "/opt/ast/bin" for SH_CMDLIB_DIR.
     42     COMPOUND_ARRAY
     43                  on  Allows all components of compound variables except the
     44                      first to be any string by enclosing in [...].  It also
     45                      allows components other than the last to be arrays.
     46                      This is experimental and only partially complete.
     47     CRNL         off <cr><nl> treated as <nl> in shell grammar.
     48     DYNAMIC      on  Dynamic loading of builtins. (Requires dlopen() interface.)
     49     ECHOPRINT    off Make echo equivalent to print.
     50     ESH          on  Compile with emacs command line editing.  The original
     51                      emacs line editor code was provided by Mike Veach at IH.
     52     FILESCAN     on  Experimental option that allows fast reading of files
     53                      using while < file;do ...; done and allowing fields in
     54                      each line to be accessed as positional parameters.
     55     FS_3D        off For use with 3-D file system.  Enabled automatically for
     56                      sytems with dynamic linking.
     57     KIA          off Allow generation of shell cross reference database with -I.
     58     MULTIBYTE    on  Multibyte character handling.  Requires mblen() and
     59                      mbctowc().
     60     NAMESPACE    on  Allows namespaces.  This is experimental, incomplete
     61                      and undocumented.
     62     OLDTERMIO    off Use either termios or termio at runtime.
     63     OO           on  Experimental object oriented extension.  This option
     64                      should disappear soon.
     65     OPTIMIZE     on  Optimize loop invariants for with for and while loops.
     66     P_SUID       off If set, all real uids, greater than or equal to this
     67                      value will require the -p flag to run suid/sgid scripts.
     68     PFSH         off Compile with support for profile shell.
     69     RAWONLY      off Turn on if the vi line mode doesn't work right unless
     70                      you do a set -o viraw.
     71     SEVENBIT     off Strip the eigth bit from characters.
     72     SPAWN        off Use spawn as combined fork/exec.  May improve speed on
     73                      some systems.
     74     STATS	 on  Add .sh.stats compound variable.
     75     SUID_EXEC    on  Execute /etc/suid_exec for setuid, setgid script.
     76     TIMEOUT      off Set this to the number of seconds for timing out and
     77                      exiting the shell when you don't enter a command.  If
     78                      non-zero, TMOUT can not be set larger than this value.
     79     TYPEDEF	 on  Enable typeset type definitions.
     80     VSH          on  Compile with vi command line editing.  The original vi
     81                      line editor code was provided by Pat Sullivan at CB.
     82 
     83 The following compile options are set automatically by the feature testing:
     84     DEVFD   Set when /dev/fd is a directory that names open files.
     85     SHELLMAGIC
     86             Set on systems that recognize script beginning with #! specially.
     87     VPIX    Set on systems the have /usr/bin/vpix program for running MS-DOS.
     88 
     89 
     90 In most instances, you will generate ksh from a higher level directory
     91 which also generates libcmd and libast libraries on which ksh depends.
     92 However, it is possible to generate ksh, with by running make -f ksh.mk
     93 in this directory.  The ksh.mk file was generated from the nmake Makefile.
     94 If you do not have make or nmake, but do have a Version 7 UNIX compatible
     95 shell, then you can run the script mamexec < Mamfile to build ksh.
     96 If you have nmake, version 2.3 or later, you can use it without the -f ksh.mk.
     97 In either case, ksh relies on libraries libast and libcmd which must be
     98 built first.  The binary for ksh becomes the file named ./ksh which can
     99 be copied to where ever you install it.
    100 
    101 If you use old make or the Mamfile, and you system has dynamic shared
    102 libraries, then you should define the variables mam_cc_static and
    103 mam_cc_dynanamic as the compiler options that request static linking
    104 and dynamic linking respectively.  This will decrease the number of
    105 shared libraries that ksh need and cut startup time substantially.
    106 
    107 The makefile should also generate shcomp, a program that will precompile
    108 a script.  ksh93 is able to recognize files in this format and process
    109 them as scripts.  You can use shcomp to send out scripts when you
    110 don't want to give away the original script source.
    111 
    112 It is advisable that you put the line PWD=$HOME;export PWD into the
    113 /etc/profile file to reduce initialization time for ksh.
    114 
    115 To be able to run setuid/setgid shell scripts, or scripts without read
    116 permission, the SUID_EXEC compile option must be on, and ksh must be installed
    117 in the /bin directory, the /usr/bin directory, the /usr/lbin directory,
    118 or the /usr/local/bin directory and the name must end in sh. The program
    119 suid_exec must be installed in the /etc directory, must be owned by root,
    120 and must be a suid program.  If you must install ksh in some other directory
    121 and want to be able to run setuid/setgid and execute only scripts, then
    122 you will have to change the source code file sh/suid_exec.c explicitly.
    123 If you do not have ksh in one of these secure locations, /bin/sh will
    124 be invoked with the -p options and will fail when you execute a setuid/setgid
    125 and/or execute only script.  Note, that ksh does not read the .profile
    126 or $ENV file when it the real and effective user/group id's are not
    127 equal.
    128 
    129 The tests sub-directory contains a number of regression tests for ksh.
    130 To run all these tests with the shell you just built, go to the tests
    131 directory and run the command
    132         SHELL=$dir/ksh $dir/ksh shtests
    133 where dir is the directory of the ksh you want to test.
    134 
    135 The file PROMO.mm is an advertisement that extolls the virtues of ksh.
    136 The file sh.1 contains the troff (man) description of this Shell.
    137 The file nval.3 contains the troff (man) description of the name-value
    138 pair library that is needed for writing built-ins that need to
    139 access shell variables.
    140 
    141 The file sh.memo contains a draft troff (mm) memo describing ksh.  The
    142 file RELEASE88 contains the changes made for ksh88.  The file RELEASE93
    143 contains the changes made in this release since ksh-88.  The file
    144 RELEASE contains bug fixes made in this release since ksh-88.  The file
    145 COMPATIBILITY contains a list of incompatibilities with ksh-88.  The
    146 file bltins.mm is a draft troff (mm) memo describing how to write
    147 built-in commands that can be loaded at run time.
    148 
    149 Most of the work for internationalization has been done with ksh93.
    150 The file ksh.msg is a generated file that contains error messages
    151 that need to be translated.  In addition, the function translate()
    152 in sh/init.c has to be completed to interface with the dictionary
    153 lookup.  The translate function takes two argument, the string
    154 that is to be translated and a type which is
    155     0 when a library string needs translation.
    156     1 when one of the error messages in ksh.msg needs translation.
    157     2 when a string in a script needs translation.  You use a $ in front
    158       of a double quoted string in a script to indicate that it
    159       needs translation.  The -D option for ksh builds the dictionary.
    160 The translate routine needs to return the translated message.
    161 For dictionaries that need to use a numeric key, it should be
    162 possible to use the strhash() function to generate numbers to
    163 go along with each of the messages and to use this number both
    164 when generating the dictionary and when converting strings.
    165 If you encounter error messages of type 1 that are not be translated via
    166 this translate() function send mail to the address below.
    167 
    168 Please report any problems or suggestions to:
    169 
    170 dgk (a] research.att.com
    171 
    172 
    173 ksh93 has been compiled and alpha tested on the following.  An asterisk
    174 signifies that ksh has been installed as /bin/sh on this machine.
    175 
    176 *    Sun OS 4.1.[123] on sparc.
    177      Sun OS 4.1.1 on sun.
    178      Solaris 2.[1-9] on sparc.
    179      Solaris 2.[4-8] on X86.
    180      HP/UX 8 on HP-9000/730.
    181      HP/UX 9 on HP-9000/730.
    182      HP/UX 10 on HP-9000/857.
    183      HP/UX 11 on pa-risc.
    184      System V Release 3 on Counterpoint C19
    185      System V Release  4 on AT&T Intel 486.
    186      System V Release  4 on NCR 4850 Intel 486.
    187      IRIX Release 4.0.? System V on SGI-MIPS.
    188      IRIX Release 5.1 System V on SGI-MIPS.
    189      IRIX Release 6.[1-5] System V on SGI-MIPS.
    190      System V Release 3.2 on 3B2. 
    191      UTS 5.2.6 on Amdahl 3090,5990,580.
    192      System V Release 3.2 on i386.
    193      SMP_DC.OSx olivetti dcosx MIServer-S 2/128.
    194      SMP_DC.OSx Pyramid dcosx MIServer-S 2/160 r3000.
    195      4.3BSD on Vax 8650.
    196      AIX release 2 on RS6000.
    197      AIX 3.2 on RS6000.
    198      Linux 1.X on Intel
    199      Linux 2.X on Intel
    200      Linux 2.X on Alpha
    201      Linux 2.X on Alpha
    202      Linux 2.X on OS/390
    203      Linux 2.X on sparc
    204      Linux 2.4 on intel itanium 64
    205      Linux Slackware on sparc64
    206 *    Linux ARM on i-PAQ 
    207      OSF1 on DEC alpha.
    208      OSF4 on DEC alpha.
    209      UMIPS 4.52 on mips.
    210      BSD-i [2-4] on X86.
    211      OpenBSD on X86
    212      NetBSD on X86
    213      FreeBSD on X86
    214      NeXT on Intel X86.
    215      NeXT on HP.
    216 *    Windows NT using UWIN on X86
    217 *    Windows NT using UWIN on alpha
    218      Windows NT using Cygwin on X86
    219      Windows NT with NutCracker libraries.
    220      Windows NT with Portage libraries.
    221      Windows 3.1 using custom C library.
    222      OpenEdition on MVS
    223      Darwin OS X on PPC
    224      MVS on OS 390
    225      SCO Openserver 3.2 on X86
    226      Unixware 7 on X86
    227 
    228 Good luck!!
    229 
    230 David Korn
    231 dgk (a] research.att.com
    232 
    233