Skip to content

Commit

Permalink
Release 1.0.0-beta.1
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
McDutchie committed May 10, 2021
1 parent 92f7ca5 commit 246062f
Show file tree
Hide file tree
Showing 10 changed files with 305 additions and 35 deletions.
135 changes: 135 additions & 0 deletions ANNOUNCE
Original file line number Diff line number Diff line change
@@ -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 [email protected] 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 changes: 4 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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.
Expand Down Expand Up @@ -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/
Expand Down
67 changes: 66 additions & 1 deletion TODO
Original file line number Diff line number Diff line change
@@ -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:

Expand All @@ -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:
Expand Down
31 changes: 18 additions & 13 deletions src/cmd/ksh93/COMPATIBILITY
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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

Expand Down
Loading

1 comment on commit 246062f

@avih
Copy link

@avih avih commented on 246062f May 10, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Congrats! keep up the good job :)

Please sign in to comment.