1N/AThis directory, and its subdirectories contain the source code
1N/Afor ksh-93; the language described in the second addition of
1N/Athe book, "The KornShell Command and Programming Language," by
1N/AMorris Bolsky and David Korn which is published by Prentice Hall.
1N/Aksh-93 has been compiled and run on several machines with several
1N/Aoperating systems. The end of this file contains a partial list of
1N/Aoperating systems and machines that ksh-93 has been known to run on.
1N/A
1N/AThe layout of files for ksh-93 has changed somewhat since ksh-88,
1N/Athe last major release. Most of the source code for ksh remains in
1N/Athe sh directory. However, the shell editing and history routines
1N/Aare in the edit sub-directory. The code for shell built-ins is
1N/Ain the bltins directory. The data directory contains read-only
1N/Adata tables and messages that are used by the shell. The include
1N/Afiles remain in the include directory and the shlib directory
1N/Ais gone. The features directory replaces the older install
1N/Adirectory. The method for generating systems specific feature
1N/Ainformation has changed substantially.
1N/A
1N/AThe Makefile file contains several compilation options that can be set
1N/Abefore compiling ksh. Options are of the form SHOPT_option and become
1N/A#define inside the code. These options are set to their recommended
1N/Avalue and some of these may disappear as options in future releases.
1N/AA value of 0, or no value represents off, 1 represents on.
1N/ANote that == is needed, not =, because these are nmake state variables
1N/Aand changing their value will cause all modules that could be affected
1N/Aby this change to be recompiled.
1N/AThe options have the following defaults and meanings:
1N/A ACCT off Shell accounting.
1N/A ACCTFILE off Enable per user accounting info.
1N/A AUDIT off For auditing specific users
1N/A AUDITFILE "/etc/ksh_audit"
1N/A APPEND on Allows var+=val string and array append.
1N/A BASH off Bash compatibility mode. It is not fully implemented
1N/A and is experimental.
1N/A BRACEPAT on C-shell type abc{d,e}f style file generation
1N/A CMDLIB_BLTIN off Makes all commands in libcmd.a builtins. The
1N/A SH_CMDLIB_DIR nmake state variable can be used to
1N/A specify a directory.
1N/A CMDLIB_DIR off Sets CMDLIB_BLTIN=1 and provides a default value
1N/A of "/opt/ast/bin" for SH_CMDLIB_DIR.
1N/A COMPOUND_ARRAY
1N/A on Allows all components of compound variables except the
1N/A first to be any string by enclosing in [...]. It also
1N/A allows components other than the last to be arrays.
1N/A This is experimental and only partially complete.
1N/A CRNL off <cr><nl> treated as <nl> in shell grammar.
1N/A DYNAMIC on Dynamic loading of builtins. (Requires dlopen() interface.)
1N/A ECHOPRINT off Make echo equivalent to print.
1N/A ESH on Compile with emacs command line editing. The original
1N/A emacs line editor code was provided by Mike Veach at IH.
1N/A FILESCAN on Experimental option that allows fast reading of files
1N/A using while < file;do ...; done and allowing fields in
1N/A each line to be accessed as positional parameters.
1N/A FS_3D off For use with 3-D file system. Enabled automatically for
1N/A sytems with dynamic linking.
1N/A KIA off Allow generation of shell cross reference database with -I.
1N/A MULTIBYTE on Multibyte character handling. Requires mblen() and
1N/A mbctowc().
1N/A NAMESPACE on Allows namespaces. This is experimental, incomplete
1N/A and undocumented.
1N/A OLDTERMIO off Use either termios or termio at runtime.
1N/A OO on Experimental object oriented extension. This option
1N/A should disappear soon.
1N/A OPTIMIZE on Optimize loop invariants for with for and while loops.
1N/A P_SUID off If set, all real uids, greater than or equal to this
1N/A value will require the -p flag to run suid/sgid scripts.
1N/A PFSH off Compile with support for profile shell.
1N/A RAWONLY off Turn on if the vi line mode doesn't work right unless
1N/A you do a set -o viraw.
1N/A SEVENBIT off Strip the eigth bit from characters.
1N/A SPAWN off Use spawn as combined fork/exec. May improve speed on
1N/A some systems.
1N/A STATS on Add .sh.stats compound variable.
1N/A SUID_EXEC on Execute /etc/suid_exec for setuid, setgid script.
1N/A TIMEOUT off Set this to the number of seconds for timing out and
1N/A exiting the shell when you don't enter a command. If
1N/A non-zero, TMOUT can not be set larger than this value.
1N/A TYPEDEF on Enable typeset type definitions.
1N/A VSH on Compile with vi command line editing. The original vi
1N/A line editor code was provided by Pat Sullivan at CB.
1N/A
1N/AThe following compile options are set automatically by the feature testing:
1N/A DEVFD Set when /dev/fd is a directory that names open files.
1N/A SHELLMAGIC
1N/A Set on systems that recognize script beginning with #! specially.
1N/A VPIX Set on systems the have /usr/bin/vpix program for running MS-DOS.
1N/A
1N/A
1N/AIn most instances, you will generate ksh from a higher level directory
1N/Awhich also generates libcmd and libast libraries on which ksh depends.
1N/AHowever, it is possible to generate ksh, with by running make -f ksh.mk
1N/Ain this directory. The ksh.mk file was generated from the nmake Makefile.
1N/AIf you do not have make or nmake, but do have a Version 7 UNIX compatible
1N/Ashell, then you can run the script mamexec < Mamfile to build ksh.
1N/AIf you have nmake, version 2.3 or later, you can use it without the -f ksh.mk.
1N/AIn either case, ksh relies on libraries libast and libcmd which must be
1N/Abuilt first. The binary for ksh becomes the file named ./ksh which can
1N/Abe copied to where ever you install it.
1N/A
1N/AIf you use old make or the Mamfile, and you system has dynamic shared
1N/Alibraries, then you should define the variables mam_cc_static and
1N/Amam_cc_dynanamic as the compiler options that request static linking
1N/Aand dynamic linking respectively. This will decrease the number of
1N/Ashared libraries that ksh need and cut startup time substantially.
1N/A
1N/AThe makefile should also generate shcomp, a program that will precompile
1N/Aa script. ksh93 is able to recognize files in this format and process
1N/Athem as scripts. You can use shcomp to send out scripts when you
1N/Adon't want to give away the original script source.
1N/A
1N/AIt is advisable that you put the line PWD=$HOME;export PWD into the
1N/A/etc/profile file to reduce initialization time for ksh.
1N/A
1N/ATo be able to run setuid/setgid shell scripts, or scripts without read
1N/Apermission, the SUID_EXEC compile option must be on, and ksh must be installed
1N/Ain the /bin directory, the /usr/bin directory, the /usr/lbin directory,
1N/Aor the /usr/local/bin directory and the name must end in sh. The program
1N/Asuid_exec must be installed in the /etc directory, must be owned by root,
1N/Aand must be a suid program. If you must install ksh in some other directory
1N/Aand want to be able to run setuid/setgid and execute only scripts, then
1N/Ayou will have to change the source code file sh/suid_exec.c explicitly.
1N/AIf you do not have ksh in one of these secure locations, /bin/sh will
1N/Abe invoked with the -p options and will fail when you execute a setuid/setgid
1N/Aand/or execute only script. Note, that ksh does not read the .profile
1N/Aor $ENV file when it the real and effective user/group id's are not
1N/Aequal.
1N/A
1N/AThe tests sub-directory contains a number of regression tests for ksh.
1N/ATo run all these tests with the shell you just built, go to the tests
1N/Adirectory and run the command
1N/A SHELL=$dir/ksh $dir/ksh shtests
1N/Awhere dir is the directory of the ksh you want to test.
1N/A
1N/AThe file PROMO.mm is an advertisement that extolls the virtues of ksh.
1N/AThe file sh.1 contains the troff (man) description of this Shell.
1N/AThe file nval.3 contains the troff (man) description of the name-value
1N/Apair library that is needed for writing built-ins that need to
1N/Aaccess shell variables.
1N/A
1N/AThe file sh.memo contains a draft troff (mm) memo describing ksh. The
1N/Afile RELEASE88 contains the changes made for ksh88. The file RELEASE93
1N/Acontains the changes made in this release since ksh-88. The file
1N/ARELEASE contains bug fixes made in this release since ksh-88. The file
1N/ACOMPATIBILITY contains a list of incompatibilities with ksh-88. The
1N/Afile bltins.mm is a draft troff (mm) memo describing how to write
1N/Abuilt-in commands that can be loaded at run time.
1N/A
1N/AMost of the work for internationalization has been done with ksh93.
1N/AThe file ksh.msg is a generated file that contains error messages
1N/Athat need to be translated. In addition, the function translate()
1N/Ain sh/init.c has to be completed to interface with the dictionary
1N/Alookup. The translate function takes two argument, the string
1N/Athat is to be translated and a type which is
1N/A 0 when a library string needs translation.
1N/A 1 when one of the error messages in ksh.msg needs translation.
1N/A 2 when a string in a script needs translation. You use a $ in front
1N/A of a double quoted string in a script to indicate that it
1N/A needs translation. The -D option for ksh builds the dictionary.
1N/AThe translate routine needs to return the translated message.
1N/AFor dictionaries that need to use a numeric key, it should be
1N/Apossible to use the strhash() function to generate numbers to
1N/Ago along with each of the messages and to use this number both
1N/Awhen generating the dictionary and when converting strings.
1N/AIf you encounter error messages of type 1 that are not be translated via
1N/Athis translate() function send mail to the address below.
1N/A
1N/APlease report any problems or suggestions to:
1N/A
1N/Adgk@research.att.com
1N/A
1N/A
1N/Aksh93 has been compiled and alpha tested on the following. An asterisk
1N/Asignifies that ksh has been installed as /bin/sh on this machine.
1N/A
1N/A* Sun OS 4.1.[123] on sparc.
1N/A Sun OS 4.1.1 on sun.
1N/A Solaris 2.[1-9] on sparc.
1N/A Solaris 2.[4-8] on X86.
1N/A HP/UX 8 on HP-9000/730.
1N/A HP/UX 9 on HP-9000/730.
1N/A HP/UX 10 on HP-9000/857.
1N/A HP/UX 11 on pa-risc.
1N/A System V Release 3 on Counterpoint C19
1N/A System V Release 4 on AT&T Intel 486.
1N/A System V Release 4 on NCR 4850 Intel 486.
1N/A IRIX Release 4.0.? System V on SGI-MIPS.
1N/A IRIX Release 5.1 System V on SGI-MIPS.
1N/A IRIX Release 6.[1-5] System V on SGI-MIPS.
1N/A System V Release 3.2 on 3B2.
1N/A UTS 5.2.6 on Amdahl 3090,5990,580.
1N/A System V Release 3.2 on i386.
1N/A SMP_DC.OSx olivetti dcosx MIServer-S 2/128.
1N/A SMP_DC.OSx Pyramid dcosx MIServer-S 2/160 r3000.
1N/A 4.3BSD on Vax 8650.
1N/A AIX release 2 on RS6000.
1N/A AIX 3.2 on RS6000.
1N/A Linux 1.X on Intel
1N/A Linux 2.X on Intel
1N/A Linux 2.X on Alpha
1N/A Linux 2.X on Alpha
1N/A Linux 2.X on OS/390
1N/A Linux 2.X on sparc
1N/A Linux 2.4 on intel itanium 64
1N/A Linux Slackware on sparc64
1N/A* Linux ARM on i-PAQ
1N/A OSF1 on DEC alpha.
1N/A OSF4 on DEC alpha.
1N/A UMIPS 4.52 on mips.
1N/A BSD-i [2-4] on X86.
1N/A OpenBSD on X86
1N/A NetBSD on X86
1N/A FreeBSD on X86
1N/A NeXT on Intel X86.
1N/A NeXT on HP.
1N/A* Windows NT using UWIN on X86
1N/A* Windows NT using UWIN on alpha
1N/A Windows NT using Cygwin on X86
1N/A Windows NT with NutCracker libraries.
1N/A Windows NT with Portage libraries.
1N/A Windows 3.1 using custom C library.
1N/A OpenEdition on MVS
1N/A Darwin OS X on PPC
1N/A MVS on OS 390
1N/A SCO Openserver 3.2 on X86
1N/A Unixware 7 on X86
1N/A
1N/AGood luck!!
1N/A
1N/ADavid Korn
1N/Adgk@research.att.com
1N/A