mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-02-24 23:14:14 +00:00
Many of these changes are minor typo fixes. The other changes (which are mostly compiler warning fixes) are: NEWS: - The --globcasedetect shell option works on older Linux kernels when used with FAT32/VFAT file systems, so remove the note about it only working with 5.2+ kernels. src/cmd/ksh93/COMPATIBILITY: - Update the documentation on function scoping with an addition from ksh93v- (this does apply to ksh93u+). src/cmd/ksh93/edit/emacs.c: - Check for '_AST_ksh_release', not 'AST_ksh_release'. src/cmd/INIT/mamake.c, src/cmd/INIT/ratz.c, src/cmd/INIT/release.c, src/cmd/builtin/pty.c: - Add more uses of UNREACHABLE() and noreturn, this time for the build system and pty. src/cmd/builtin/pty.c, src/cmd/builtin/array.c, src/cmd/ksh93/sh/name.c, src/cmd/ksh93/sh/nvtype.c, src/cmd/ksh93/sh/suid_exec.c: - Fix six -Wunused-variable warnings (the name.c nv_arrayptr() fixes are also in ksh93v-). - Remove the unused 'tableval' function to fix a -Wunused-function warning. src/cmd/ksh93/sh/lex.c: - Remove unused 'SHOPT_DOS' code, which isn't enabled anywhere. https://github.com/att/ast/issues/272#issuecomment-354363112 src/cmd/ksh93/bltins/misc.c, src/cmd/ksh93/bltins/trap.c, src/cmd/ksh93/bltins/typeset.c: - Add dictionary generator function declarations for former aliases that are now builtins (re:1fbbeaa1
,ef1621c1
,3ba4900e
). - For consistency with the rest of the codebase, use '(void)' instead of '()' for print_cpu_times. src/cmd/ksh93/sh/init.c, src/lib/libast/path/pathshell.c: - Move the otherwise unused EXE macro to pathshell() and only search for 'sh.exe' on Windows. src/cmd/ksh93/sh/xec.c, src/lib/libast/include/ast.h: - Add an empty definition for inline when compiling with C89. This allows the timeval_to_double() function to be inlined. src/cmd/ksh93/include/shlex.h: - Remove the unused 'PIPESYM2' macro. src/cmd/ksh93/tests/pty.sh: - Add '# err_exit #' to count the regression test added in commit113a9392
. src/lib/libast/disc/sfdcdio.c: - Move diordwr, dioread, diowrite and dioexcept behind '#ifdef F_DIOINFO' to fix one -Wunused-variable warning and multiple -Wunused-function warnings (sfdcdio() only uses these functions when F_DIOINFO is defined). src/lib/libast/string/fmtdev.c: - Fix two -Wimplicit-function-declaration warnings on Linux by including sys/sysmacros.h in fmtdev().
200 lines
10 KiB
Text
200 lines
10 KiB
Text
This directory, and its subdirectories contain the source code
|
|
for ksh-93; the language described in the second addition of
|
|
the book, "The KornShell Command and Programming Language," by
|
|
Morris Bolsky and David Korn which is published by Prentice Hall.
|
|
ksh-93 has been compiled and run on several machines with several
|
|
operating systems. The end of this file contains a partial list of
|
|
operating systems and machines that ksh-93 has been known to run on.
|
|
|
|
Most of the source code for ksh is in the src/cmd/ksh93/sh
|
|
directory. For information on what's where, see the file DESIGN.
|
|
|
|
A new '-o posix' shell option has been added to ksh 93u+m that makes the
|
|
ksh language more compatible with other shells by following the POSIX
|
|
standard more closely. See the manual page for details. It is enabled by
|
|
default if ksh is invoked as sh, otherwise it is disabled by default.
|
|
|
|
The Makefile file contains several compilation options that can be set
|
|
before compiling ksh. Options are of the form SHOPT_option and become
|
|
#define inside the code. These options are set to their recommended
|
|
value and some of these may disappear as options in future releases.
|
|
A value of 0, or no value represents off, 1 represents on.
|
|
Note that == is needed, not =, because these are nmake state variables
|
|
and changing their value will cause all modules that could be affected
|
|
by this change to be recompiled.
|
|
The options have the following defaults and meanings:
|
|
ACCT off Shell accounting.
|
|
ACCTFILE off Enable per user accounting info.
|
|
AUDIT off For auditing specific users
|
|
AUDITFILE "/etc/ksh_audit"
|
|
APPEND on Allows var+=val string and array append.
|
|
BASH off Bash compatibility mode. It is not fully implemented
|
|
and is experimental.
|
|
BRACEPAT on C-shell type abc{d,e}f style file generation
|
|
CMDLIB_BLTIN off Makes all commands in libcmd.a builtins. The
|
|
SH_CMDLIB_DIR nmake state variable can be used to
|
|
specify a directory.
|
|
CMDLIB_DIR off Sets CMDLIB_BLTIN=1 and provides a default value
|
|
of "/opt/ast/bin" for SH_CMDLIB_DIR.
|
|
COMPOUND_ARRAY
|
|
on Allows all components of compound variables except the
|
|
first to be any string by enclosing in [...]. It also
|
|
allows components other than the last to be arrays.
|
|
This is experimental and only partially complete.
|
|
CRNL off <cr><nl> treated as <nl> in shell grammar.
|
|
DYNAMIC on Dynamic loading of builtins. (Requires dlopen() interface.)
|
|
ECHOPRINT off Make echo equivalent to print.
|
|
ESH on Compile with emacs command line editing. The original
|
|
emacs line editor code was provided by Mike Veach at IH.
|
|
FILESCAN on Experimental option that allows fast reading of files
|
|
using while < file;do ...; done and allowing fields in
|
|
each line to be accessed as positional parameters.
|
|
KIA off Allow generation of shell cross reference database with -I.
|
|
MULTIBYTE on Multibyte character handling. Requires mblen() and
|
|
mbctowc().
|
|
NAMESPACE on Allows namespaces. This is experimental, incomplete
|
|
and undocumented.
|
|
OLDTERMIO off Use either termios or termio at runtime.
|
|
OO on Experimental object oriented extension. This option
|
|
should disappear soon.
|
|
OPTIMIZE on Optimize loop invariants for with for and while loops.
|
|
P_SUID off If set, all real uids, greater than or equal to this
|
|
value will require the -p flag to run suid/sgid scripts.
|
|
PFSH off Compile with support for profile shell.
|
|
RAWONLY off Turn on if the vi line mode doesn't work right unless
|
|
you do a set -o viraw.
|
|
SEVENBIT off Strip the eighth bit from characters.
|
|
SPAWN off Use spawn as combined fork/exec. May improve speed on
|
|
some systems.
|
|
STATS on Add .sh.stats compound variable.
|
|
SUID_EXEC on Execute /etc/suid_exec for setuid, setgid script.
|
|
TIMEOUT off Set this to the number of seconds for timing out and
|
|
exiting the shell when you don't enter a command. If
|
|
non-zero, TMOUT can not be set larger than this value.
|
|
TYPEDEF on Enable typeset type definitions.
|
|
VSH on Compile with vi command line editing. The original vi
|
|
line editor code was provided by Pat Sullivan at CB.
|
|
|
|
The following compile options are set automatically by the feature testing:
|
|
DEVFD Set when /dev/fd is a directory that names open files.
|
|
SHELLMAGIC
|
|
Set on systems that recognize script beginning with #! specially.
|
|
|
|
|
|
In most instances, you will generate ksh from a higher level directory
|
|
which also generates libcmd and libast libraries on which ksh depends.
|
|
However, it is possible to generate ksh, with by running make -f ksh.mk
|
|
in this directory. The ksh.mk file was generated from the nmake Makefile.
|
|
If you do not have make or nmake, but do have a Version 7 UNIX compatible
|
|
shell, then you can run the script mamexec < Mamfile to build ksh.
|
|
If you have nmake, version 2.3 or later, you can use it without the -f ksh.mk.
|
|
In either case, ksh relies on libraries libast and libcmd which must be
|
|
built first. The binary for ksh becomes the file named ./ksh which can
|
|
be copied to where ever you install it.
|
|
|
|
If you use old make or the Mamfile, and you system has dynamic shared
|
|
libraries, then you should define the variables mam_cc_static and
|
|
mam_cc_dynanamic as the compiler options that request static linking
|
|
and dynamic linking respectively. This will decrease the number of
|
|
shared libraries that ksh need and cut startup time substantially.
|
|
|
|
The makefile should also generate shcomp, a program that will precompile
|
|
a script. ksh93 is able to recognize files in this format and process
|
|
them as scripts. You can use shcomp to send out scripts when you
|
|
don't want to give away the original script source.
|
|
|
|
To be able to run setuid/setgid shell scripts, or scripts without read
|
|
permission, the SUID_EXEC compile option must be on, and ksh must be installed
|
|
in the /bin directory, the /usr/bin directory, the /usr/lbin directory,
|
|
or the /usr/local/bin directory and the name must end in sh. The program
|
|
suid_exec must be installed in the /etc directory, must be owned by root,
|
|
and must be a suid program. If you must install ksh in some other directory
|
|
and want to be able to run setuid/setgid and execute only scripts, then
|
|
you will have to change the source code file sh/suid_exec.c explicitly.
|
|
If you do not have ksh in one of these secure locations, /bin/sh will
|
|
be invoked with the -p options and will fail when you execute a setuid/setgid
|
|
and/or execute only script. Note, that ksh does not read the .profile
|
|
or $ENV file when it the real and effective user/group id's are not
|
|
equal.
|
|
|
|
The tests subdirectory contains a number of regression tests for ksh.
|
|
To run all these tests with the shell you just built, run the command
|
|
bin/shtests
|
|
For help and more options, type
|
|
bin/shtests --man
|
|
|
|
The file PROMO.mm is an advertisement that extolls the virtues of ksh.
|
|
The file sh.1 contains the troff (man) description of this Shell.
|
|
The file nval.3 contains the troff (man) description of the name-value
|
|
pair library that is needed for writing built-ins that need to
|
|
access shell variables.
|
|
|
|
The file sh.memo contains a draft troff (mm) memo describing ksh. The
|
|
file RELEASE88 contains the changes made for ksh88. The file RELEASE93
|
|
contains the changes made in this release since ksh-88. The file
|
|
RELEASE contains bug fixes made in this release since ksh-88. The file
|
|
COMPATIBILITY contains a list of incompatibilities with ksh-88. The
|
|
file bltins.mm is a draft troff (mm) memo describing how to write
|
|
built-in commands that can be loaded at run time.
|
|
|
|
Most of the work for internationalization has been done with ksh93.
|
|
The file ksh.msg is a generated file that contains error messages
|
|
that need to be translated. In addition, the function translate()
|
|
in sh/init.c has to be completed to interface with the dictionary
|
|
lookup. The translate function takes two argument, the string
|
|
that is to be translated and a type which is
|
|
0 when a library string needs translation.
|
|
1 when one of the error messages in ksh.msg needs translation.
|
|
2 when a string in a script needs translation. You use a $ in front
|
|
of a double quoted string in a script to indicate that it
|
|
needs translation. The -D option for ksh builds the dictionary.
|
|
The translate routine needs to return the translated message.
|
|
For dictionaries that need to use a numeric key, it should be
|
|
possible to use the strhash() function to generate numbers to
|
|
go along with each of the messages and to use this number both
|
|
when generating the dictionary and when converting strings.
|
|
If you encounter error messages of type 1 that are not be translated via
|
|
this translate() function send mail to the address below.
|
|
|
|
Please report any problems or suggestions to:
|
|
|
|
https://github.com/ksh93/ksh
|
|
|
|
|
|
ksh 93u+m 1.0.0 has been compiled and alpha tested on the following.
|
|
An asterisk signifies minor regression test failures (one or two minor
|
|
things amiss), two asterisks signify moderate regression test failures
|
|
(some functionality does not work), and three asterisks signify serious
|
|
failures (crashes, and/or essential functionality does not work).
|
|
|
|
* AIX 7.1 on RISC (PowerPC)
|
|
* DragonFly BSD 5.8 on x86_64
|
|
FreeBSD 12.2 on x86_64
|
|
FreeBSD 12.2 on arm64 (thanks to hyenias for donating access to a Pi)
|
|
GNU/Linux: Alpine 3.12.3 (musl C library) on x86_64
|
|
GNU/Linux: CentOS 8.2 on x86_64
|
|
GNU/Linux: Debian 10.7 on x86_64
|
|
GNU/Linux: Gentoo 2.7 on i386
|
|
GNU/Linux: NixOS 19.09 on x86_64
|
|
GNU/Linux: Slackware 14.2 on x86_64
|
|
GNU/Linux: Ubuntu 16.04 on x86_64
|
|
GNU/Linux: Void Linux (musl C library) on x86_64
|
|
*** HP-UX B.11.11 on pa-risc
|
|
* illumos: OmniOS 2020-08-19 (gcc) on x86_64
|
|
macOS 10.14.6 (Mojave) on x86_64
|
|
*** NetBSD 8.1 and 9.0 on x86_64
|
|
* OpenBSD 6.8 on x86_64
|
|
** QNX 6.5.0 on i386
|
|
* Solaris 11.4 (gcc) on x86_64
|
|
Solaris 11.4 (Solaris Studio 12.5 cc) on x86_64
|
|
* UnixWare 7.1.4 on x86
|
|
*** Windows 7 using Cygwin on x86
|
|
|
|
Good luck!!
|
|
|
|
The ksh 93u+m contributors
|
|
https://github.com/ksh93/ksh
|
|
|
|
Originally written by:
|
|
David Korn
|
|
dgk@research.att.com
|