1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-15 04:32:24 +00:00

Release 1.0.0-beta.1

In May 2020, when every KornShell (ksh93) development project was
abandoned, development was rebooted in a new fork based on the last
stable AT&T version: ksh 93u+. Now, one year and hundreds of bug
fixes later, the first beta version is ready, and KornShell lives
again. This new fork is called ksh 93u+m as a permanent nod to its
origin; a standard semantic version number is added starting at
1.0.0-beta.1. Please test the beta and report any bugs you find,
or help us fix known bugs.
This commit is contained in:
Martijn Dekker 2021-05-10 18:40:44 +02:00
parent 92f7ca5423
commit 246062ff0b
10 changed files with 305 additions and 35 deletions

135
ANNOUNCE Normal file
View file

@ -0,0 +1,135 @@
Announcing: KornShell 93u+m 1.0.0-beta.1
https://github.com/ksh93/ksh
In May 2020, when every KornShell (ksh93) development project was
abandoned, development was rebooted in a new fork based on the last
stable AT&T version: ksh 93u+. Now, one year and hundreds of bug fixes
later, the first beta version is ready, and KornShell lives again. This
new fork is called ksh 93u+m as a permanent nod to its origin; a standard
semantic version number is added starting at 1.0.0-beta.1. Please test
the beta and report any bugs you find, or help us fix known bugs.
Main developers: Martijn Dekker, Johnothan King, hyenias
Contributors: Andy Fiddaman, Anuradha Weeraman, Chase, Gordon Woodhull,
Govind Kamat, Harald van Dijk, Lev Kujawski, Marc Wilson, Sterling Jensen
HOW TO GET IT
Please download the source code tarball from our GitHub releases page:
https://github.com/ksh93/ksh/releases
To build, follow the instructions in README.md or src/cmd/ksh93/README.
Hopefully, OS/distro packagers will make ksh 93u+m packages available soon.
If you would like to have a binary for your OS from us, ask and we'll try
to build one and add it to the releases page.
HOW TO GET INVOLVED
To report a bug, please open an issue at our GitHub page (see above).
Alternatively, email me at martijn@inlv.org with your report.
To get involved in development, read the brief policy information in
README.md and then jump right in with a pull request or email a patch.
See the TODO file in the top-level directory for a to-do list.
MAIN CHANGES SINCE KSH 93U+ 2012-08-01
Hundreds of bugs have been fixed, including many serious/critical bugs.
This includes upstreamed patches from OpenSUSE, Red Hat, and Solaris, fixes
backported from the abandoned 93v- beta and ksh2020 fork, as well as many
new fixes from the community. See the NEWS file for more information, and
the git commit log for complete documentation of every fix. Incompatible
changes have been minimised, but not at the expense of fixing bugs. For a
list of potentially incompatible changes, see src/cmd/ksh93/COMPATIBILITY.
Though there was a "no new features, bugfixes only" policy, some new
features were found necessary, either to fix serious design flaws or to
complete functionality that was evidently intended, but not finished.
Below is a summary of these new features.
New command line editor features:
- The forward-delete and End keys are now handled as expected in the
emacs and vi built-in line editors.
- In the vi and emacs line editors, repeat count parameters can now also
be used for the arrow keys and the forward-delete key. E.g., in emacs
mode, <ESC> 7 <left-arrow> will now move the cursor seven positions to
the left. In vi control mode, this would be entered as: 7 <left-arrow>.
New shell language features:
- The &>file redirection shorthand (for >file 2>&1) is now available for
all scripts and interactive sessions and not only for profile/login
scripts, bringing ksh 93u+m in line with mksh, bash, and zsh.
- File name generation (a.k.a. pathname expansion, a.k.a. globbing) now
never matches the special navigational names '.' (current directory)
and '..' (parent directory). This change makes a pattern like .*
useful; it now matches all hidden files (dotfiles) in the current
directory, without the harmful inclusion of '.' and '..'.
- Tilde expansion can now be extended or modified by defining a
.sh.tilde.get or .sh.tilde.set discipline function. This replaces a
2004 undocumented attempt to add this functionality via a .sh.tilde
command, which never worked and crashed the shell. See the manual for
details on the new method.
New features in built-in commands:
- Usage error messages now show the --help/--man self-documentation options.
- Path-bound built-ins (such as /opt/ast/bin/cat) can now be executed by
invoking the canonical path, so the following will now work as expected:
$ /opt/ast/bin/cat --version
version cat (AT&T Research) 2012-05-31
- 'command -x' now looks for external commands only, skipping built-ins.
In addition, its xargs-like functionality no longer freezes the shell on
Linux and macOS, making it effectively a new feature on these systems.
- 'redirect' now checks if all arguments are valid redirections before
performing them. If an error occurs, it issues an error message instead
of terminating the shell.
- 'suspend' now refuses to suspend a login shell, as there is probably no
parent shell to return to and the login session would freeze.
- 'times' now gives high precision output in a POSIX compliant format.
- 'typeset' now gives an informative error message if an incompatible
combination of options is given.
- 'whence -v/-a' now reports the location of autoloadable functions.
New features in shell options:
- A new --globcasedetect shell option is added on OSs where we can
check for a case-insensitive file system (currently Windows/Cygwin,
macOS, Linux and QNX 7.0+). When this option is turned on, file name
generation (globbing), as well as file name tab completion on
interactive shells, automatically become case-insensitive on file
systems where the difference between upper and lower case is ignored
for file names. This is transparently determined for each directory, so
a path pattern that spans multiple file systems can be part
case-sensitive and part case-insensitive.
- A new --nobackslashctrl shell option disables the special escaping
behaviour of the backslash character in the emacs and vi built-in
editors. Particularly in the emacs editor, this makes it much easier to
go backward, insert a forgotten backslash into a command, and then
continue editing without having your next cursor key replace your
backslash with garbage. Note that Ctrl+V (or whatever other character
was set using 'stty lnext') always escapes all control characters in
either editing mode.
- A new --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.
- Enhancement to -G/--globstar: symbolic links to directories are now
followed if they match a normal (non-**) glob pattern. For example, if
'/lnk' is a symlink to a directory, '/lnk/**' and '/l?k/**' now work as
you would expect.

4
NEWS
View file

@ -3,6 +3,10 @@ For full details, see the git log at: https://github.com/ksh93/ksh
Any uppercase BUG_* names are modernish shell bug IDs.
2021-05-10:
- Release 1.0.0-beta.1.
2021-05-07:
- Backported three ksh 93v- math.tab changes, allowing for an exp10()

View file

@ -17,8 +17,8 @@ To see what's left to fix, see [the issue tracker](https://github.com/ksh93/ksh/
## Policy
1. No new features; bug fixes only (but see items 3 and 4).
Feature development is for a future separate branch.
1. Fixing bugs is main focus of the 1.x series.
Major feature development is for future versions (2.x and up).
2. No major rewrites. No refactoring code that is not fully understood.
3. No changes in documented behaviour, except if required for compliance with the
[POSIX shell language standard](https://pubs.opengroup.org/onlinepubs/9699919799/utilities/contents.html)
@ -29,7 +29,7 @@ To see what's left to fix, see [the issue tracker](https://github.com/ksh93/ksh/
6. To help increase everyone's understanding of this code base, fixes and
significant changes should be fully documented in commit messages.
7. Code style varies somewhat in this historic code base.
Your changes should match the style of the code surrounding it.
Your changes should match the style of the code surrounding them.
Indent with tabs, assuming an 8-space tab width.
Opening braces are on a line of their own, at the same indentation level
as their corresponding closing brace.
@ -109,7 +109,7 @@ bin/shtests --man
### Install
Automated installation is not supported.
Automated installation is not supported yet.
To install manually:
```sh
cp arch/$(bin/package host type)/bin/ksh /usr/local/bin/

67
TODO
View file

@ -1,8 +1,70 @@
TODO for AT&T ksh93, 93u+m bugfix branch
TODO for ksh 93u+m
See the issue tracker:
https://github.com/ksh93/ksh/issues
Known bugs in ksh 93u+m 1.0.0-beta.1 (help is wanted to fix these):
* Memory leak when initialising associative array in subshell
https://github.com/ksh93/ksh/issues/94
* Command substitution botches output of non-waited-for child processes
https://github.com/ksh93/ksh/issues/124
* Intermittent coprocess hang on Debian/Ubuntu and Solaris
https://github.com/ksh93/ksh/issues/132
* Wrong typeset -p output after unsetting multidimensional array elements
https://github.com/ksh93/ksh/issues/148
* File descriptor is unexpectedly closed after exec in subshell
https://github.com/ksh93/ksh/issues/161
* printf %T date parsing: GNU-style "ago" date spec completely broken
https://github.com/ksh93/ksh/issues/182
* typeset -L/-R: string length breaks on multibyte characters
https://github.com/ksh93/ksh/issues/189
* Linux i386: variable expansion corruption in single-line function
https://github.com/ksh93/ksh/issues/203
* Segfault with very large extended glob patterns
https://github.com/ksh93/ksh/issues/207
* funcname.ksh crashes under standard malloc
https://github.com/ksh93/ksh/issues/212
* process substitution cannot be part of a larger argument
https://github.com/ksh93/ksh/issues/215
* Compound array regression on OpenBSD with standard malloc
https://github.com/ksh93/ksh/issues/229
* 'typeset -m'-related crash on OpenBSD compiled with standard malloc
https://github.com/ksh93/ksh/issues/231
* Freeze/crash on OpenBSD with -D_std_malloc involving typeset and command
substitution
https://github.com/ksh93/ksh/issues/264
* Nested compound assignment misparsed in $(...) command substitution
https://github.com/ksh93/ksh/issues/269
Enhancements to do:
* Implement to-be-POSIX 'local' builtin
https://github.com/ksh93/ksh/issues/123
* Add -T (-o functrace) option as in bash
https://github.com/ksh93/ksh/issues/162
* Unicode code points in $'...' strings should vary according to the locale
https://github.com/ksh93/ksh/issues/193
* Re-allow building dynamic libraries
https://github.com/ksh93/ksh/issues/302
______
Fix regression test failures:
@ -13,6 +75,9 @@ Fix regression test failures:
is used. These probably represent real ksh93 bugs exposed by OpenBSD's
security hardening mechanisms.
- Several known memory leaks have their tests disabled in tests/leaks.sh
and are marked TODO. These need tracking down and fixing.
______
Fix currently known bugs affecting shell scripting. These are identified by
their modernish IDs. For exact details, see code/comments in:

View file

@ -35,17 +35,22 @@ For more details, see the NEWS file and for complete details, see the git log.
message instead of terminating the shell.
- 'suspend' now refuses to suspend a login shell, as there is probably
no parent shell to return to and the login session would freeze.
If you really want to suspend a login shell, use 'kill -s STOP $$'.
- 'times' now gives high precision output in a POSIX compliant format.
6. 'command' no longer expands aliases in its first argument, as this is
no longer required after the foregoing change. In the unlikely event
that you still need this behavior, you can set:
6. 'command' and 'nohup' no longer expand aliases in their first argument,
as this is no longer required after the foregoing change. In the
unlikely event that you still need this behavior, you can set:
alias command='command '
alias nohup='nohup '
7. The undocumented 'login' and 'newgrp' builtin commands have been
removed. These replaced your shell session with the external commands
7. The 'login' and 'newgrp' special built-in commands have been removed,
so it is no longer an error to define shell functions by these names.
These built-ins replaced your shell session with the external commands
by the same name, as in 'exec'. If an error occurred (e.g. due to a
typo), you would end up immediately logged out. If you do want this
typo), you would end up immediately logged out, except on a few
commercial Unix systems whose 'login' and 'newgrp' cope with this
by starting a new shell session upon error. If you do want the old
behavior, you can restore it by setting:
alias login='exec login'
alias newgrp='exec newgrp'
@ -55,13 +60,13 @@ For more details, see the NEWS file and for complete details, see the git log.
use cases that are expected to work. For example:
n='[0-9]'
case $n in
[0-9]) echo "$n is a number" ;;
[0-9]) echo "$n is a digit" ;;
esac
would output "[0-9] is a number". In the unlikely event that a script
would output "[0-9] is a digit". In the unlikely event that a script
does rely on this behavior, it can be fixed like this:
case $n in
[0-9] | "[0-9]")
echo "$n is a number or the number pattern" ;;
echo "$n is a digit or the digit pattern" ;;
esac
9. If 'set -u'/'set -o nounset' is active, then the shell now errors out
@ -71,7 +76,7 @@ For more details, see the NEWS file and for complete details, see the git log.
10. If 'set -u'/'set -o nounset' is active, then the shell now errors out
if $! is accessed before the shell has launched any background process.
11. The 'print', 'printf' and 'echo' builtin commands now return a nonzero
11. The 'print', 'printf' and 'echo' built-in commands now return a nonzero
exit status if an input/output error occurs.
12. Four obsolete date format specifiers for 'printf %(format)T' were
@ -80,7 +85,7 @@ For more details, see the NEWS file and for complete details, see the git log.
- %f now returns a date with the format '%Y.%m.%d-%H:%M:%S'.
- %q now returns the quarter of the current year.
13. The 'typeset' builtin now properly detects and reports options that
13. The 'typeset' built-in now properly detects and reports options that
cannot be used together if they are given as part of the same command.
14. The DEBUG trap has reverted to pre-93t behavior. It is now once again
@ -118,14 +123,14 @@ For more details, see the NEWS file and for complete details, see the git log.
ksh -c 'cd /var; PWD=/tmp cd /usr; echo $PWD'
now prints '/bin' followed by '/var'.
23. Path-bound builtins (such as /opt/ast/bin/cat) can now be executed
23. Path-bound built-ins (such as /opt/ast/bin/cat) can now be executed
by invoking the canonical path, so the following will now work:
$ /opt/ast/bin/cat --version
version cat (AT&T Research) 2012-05-31
$ (PATH=/opt/ast/bin:$PATH; "$(whence -p cat)" --version)
version cat (AT&T Research) 2012-05-31
In the event an external command by that path exists, the path-bound
builtin will now override it when invoked using the canonical path.
built-in will now override it when invoked using the canonical path.
To invoke a possible external command at that path, you can still use
a non-canonical path, e.g.: /opt//ast/bin/cat or /opt/ast/./bin/cat

View file

@ -9,10 +9,7 @@ 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.
#### COMPILE-TIME OPTIONS ####
The SHOPT.sh file contains several compilation options that can be set
before compiling ksh. Options are of the form SHOPT_option and become
@ -22,11 +19,17 @@ A value of 0 represents off, 1 represents on, no value means probe. For
options where no feature probe is available, probe is the same as off.
The options have the following defaults and meanings:
2DMATCH on Two-dimensional ${.sh.match} for ${var//pat/str}.
ACCT off Shell accounting.
ACCTFILE off Enable per user accounting info.
AUDIT off For auditing specific users
AUDITFILE "/etc/ksh_audit"
BGX on Enables background job extensions. Noted by "J" in the
version string when enabled. (1) JOBMAX=n limits the
number of concurrent background jobs to n; the (n+1)th
@ -35,18 +38,26 @@ The options have the following defaults and meanings:
completing background job gets its own trap; $! is set to
the job pid and $? is set to the job exit status at the
beginning of the trap.
BRACEPAT on C-shell type abc{d,e}f style file generation
CMDLIB_HDR "<cmdlist.h>"
The header in which you can provide a custom list of
libcmd commands to provide as path-bound built-ins.
CMDLIB_DIR "\"/opt/ast/bin\""
The default virtual directory prefix for path-bound
built-ins. The value must include double quotes.
CRNL off <cr><nl> treated as <nl> in shell grammar.
DEVFD Use the more secure /dev/fd mechanism instead of FIFOs for
process substitutions. On by default on OSs with /dev/fd.
DYNAMIC on Dynamic loading of builtins. (Requires dlopen() interface.)
ECHOPRINT off Make echo equivalent to print.
EDPREDICT off Enables history pattern search menu. As you begin a line
with a #, the following characters are treated as a shell
pattern and cause matching lines from the history file to
@ -54,15 +65,19 @@ The options have the following defaults and meanings:
scroll up and down this list or you can use <ESC>nTAB to
make this the current line (n defaults to 1 if omitted).
Experimental. Bugs: https://github.com/ksh93/ksh/issues/233
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.
FIXEDARRAY on When using typeset, a name in the format NAME[N]
creates a fixed-size array and any attempt to access a
subscript N or higher is an error. Multidimensional
fixed-size arrays NAME[N1][N2]... are also supported.
GLOBCASEDET Adds the 'globcasedetect' shell option. When this shell
option is turned on, file name generation (globbing)
and file name listing and completion automatically become
@ -70,41 +85,65 @@ The options have the following defaults and meanings:
between upper- and lowercase is ignored for file names.
This compile-time option is enabled by default on operating
systems that can support case-insensitive file systems.
HISTEXPAND on Enable !-style history expansion similar to csh(1).
KIA off Allow generation of shell cross reference database with -R.
As of 2021-05-10, no tool that can parse this database is
known. If you know of any, please contact us.
MULTIBYTE on Multibyte character handling. Requires mblen() and
mbctowc().
NAMESPACE on Allows namespaces. This is experimental, incomplete
and undocumented.
NOECHOE off Disable the '-e' option to the 'echo' command,
unless SHOPT_ECHOPRINT is enabled.
OLDTERMIO off Use either termios or termio at runtime.
OPTIMIZE on Optimize loop invariants for with for and while loops.
PFSH off Compile with support for profile shell. (Solaris; obsolete)
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.
RAWONLY on Turn on if the vi line mode doesn't work right unless
you do a set -o viraw.
REGRESS off Enable the __regress__ built-in command and instrumented
intercepts for testing.
REMOTE off Set --rc (read profile scripts) even if ksh was invoked
with standard input on a socket, i.e. as a remote shell.
SPAWN on Use posix_spawn(3) as combined fork/exec if job control
is not active. Improves speed.
STATS on Add .sh.stats compound variable.
SUID_EXEC on Execute /etc/suid_exec for setuid, setgid script.
SYSRC Source /etc/ksh.kshrc on initializing an interactive
shell. This is on by default if /etc/ksh.kshrc or
/etc/bash.bashrc exists at compile time.
TEST_L Add 'test -l' as an alias for 'test -L'. This is on by
default if the OS's external 'test' command supports it.
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.
#### BUILDING KSH 93U+M ####
To build ksh (as well as libcmd and libast libraries on which ksh depends),
cd to the top directory and run:
@ -139,7 +178,7 @@ For more information, run:
Many other commands in this repo self-document via the --help, --man and
--html options; those that do have no separate manual page.
Automated installation is not supported. To install manually:
Automated installation is not supported yet. To install manually:
cp arch/$(bin/package host type)/bin/ksh /usr/local/bin/
cp src/cmd/ksh93/sh.1 /usr/local/share/man/man1/ksh.1
@ -165,12 +204,16 @@ 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.
#### TESTING KSH ####
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
#### OTHER DOCUMENTATION ####
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
@ -178,23 +221,20 @@ 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
file builtins.mm is a draft troff (mm) memo describing how to write
built-in commands that can be loaded at run time.
Please report any problems or suggestions to:
The file NEWS in the top-level directory contains bug fixes and other
changes made in the ksh 93u+m fork and supporting libraries. The file
COMPATIBILITY contains a list of potential incompatibilities.
https://github.com/ksh93/ksh
#### TESTED SYSTEMS ####
ksh 93u+m 1.0.0 has been compiled and alpha tested on the following.
ksh 93u+m 1.0.0.beta-1 has been compiled and 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).
failures (crashes, and/or important functionality does not work).
* AIX 7.1 on RISC (PowerPC)
* DragonFly BSD 5.8 on x86_64
@ -207,9 +247,12 @@ failures (crashes, and/or essential functionality does not work).
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: Ubuntu 18.04 on armv7l (32-bit)
GNU/Linux: Ubuntu 20.04 on aarch64
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.13.6 (High Sierra) 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
@ -219,6 +262,12 @@ failures (crashes, and/or essential functionality does not work).
* UnixWare 7.1.4 on x86
*** Windows 7 using Cygwin on x86
#### REPORTING BUGS ####
Please report any problems or suggestions by opening an issue at:
https://github.com/ksh93/ksh
Alternatively, email martijn@inlv.org (timely response *not* promised).
Good luck!!
The ksh 93u+m contributors

View file

@ -1,3 +1,7 @@
This file is of historic interest. For recent changes in both ksh 93u+m and
the accompanying libraries, see the file NEWS in the top-level directory.
____
12-08-01 --- Release ksh93u+ ---
12-08-01 A bug that ignored interrupts for some builtins (e.g. cmdtst::grep)
that read from stdin has been fixed.

View file

@ -1,3 +1,7 @@
This file is of historic interest. For recent changes in both ksh 93u+m and
the accompanying libraries, see the file NEWS in the top-level directory.
____
This is a list of changes that have been made since the 11/16/88 version
of ksh.

View file

@ -1,3 +1,7 @@
This file is of historic interest. For recent changes in both ksh 93u+m and
the accompanying libraries, see the file NEWS in the top-level directory.
____
This is a list of changes that have been made since the 12/28/93 version
of ksh.

View file

@ -20,8 +20,8 @@
***********************************************************************/
#define SH_RELEASE_FORK "93u+m" /* only change if you develop a new ksh93 fork */
#define SH_RELEASE_SVER "1.0.0-alpha" /* semantic version number: https://semver.org */
#define SH_RELEASE_DATE "2021-05-07" /* must be in this format for $((.sh.version)) */
#define SH_RELEASE_SVER "1.0.0-beta.1" /* semantic version number: https://semver.org */
#define SH_RELEASE_DATE "2021-05-10" /* must be in this format for $((.sh.version)) */
#define SH_RELEASE_CPYR "(c) 2020-2021 Contributors to ksh " SH_RELEASE_FORK
/* Scripts sometimes field-split ${.sh.version}, so don't change amount of whitespace. */