That is, 5.1 with the four post-release patches available so far.
This is a terse description of the new features added to bash-5.1 since
the release of bash-5.0. As always, the manual page (doc/bash.1) is
the place to look for complete descriptions.
1. New Features in Bash
a. `bind -x' now supports different bindings for different editing modes and
keymaps.
b. Bash attempts to optimize the number of times it forks when executing
commands in subshells and from `bash -c'.
c. Here documents and here strings now use pipes for the expanded document if
it's smaller than the pipe buffer size, reverting to temporary files if it's
larger.
d. There are new loadable builtins: mktemp, accept, mkfifo, csv, cut/lcut
e. In posix mode, `trap -p' now displays signals whose disposition is SIG_DFL
and those that were SIG_IGN when the shell starts.
f. The shell now expands the history number (e.g., in PS1) even if it is not
currently saving commands to the history list.
g. `read -e' may now be used with arbitrary file descriptors (`read -u N').
h. The `select' builtin now runs traps if its internal call to the read builtin
is interrupted by a signal.
i. SRANDOM: a new variable that expands to a 32-bit random number that is not
produced by an LCRNG, and uses getrandom/getentropy, falling back to
/dev/urandom or arc4random if available. There is a fallback generator if
none of these are available.
j. shell-transpose-words: a new bindable readline command that uses the same
definition of word as shell-forward-word, etc.
k. The shell now adds default bindings for shell-forward-word,
shell-backward-word, shell-transpose-words, and shell-kill-word.
l. Bash now allows ARGV0 appearing in the initial shell environment to set $0.
m. If `unset' is executed without option arguments, bash tries to unset a shell
function if a name argument cannot be a shell variable name because it's not
an identifier.
n. The `test -N' operator uses nanosecond timestamp granularity if it's
available.
o. Bash posix mode now treats assignment statements preceding shell function
definitions the same as in its default mode, since POSIX has changed and
no longer requires those assignments to persist after the function returns
(POSIX interp 654).
p. BASH_REMATCH is no longer readonly.
q. wait: has a new -p VARNAME option, which stores the PID returned by `wait -n'
or `wait' without arguments.
r. Sorting the results of pathname expansion now uses byte-by-byte comparisons
if two strings collate equally to impose a total order; the result of a
POSIX interpretation.
s. Bash now allows SIGINT trap handlers to execute recursively.
t. Bash now saves and restores state around setting and unsetting posix mode,
instead of having unsetting posix mode set a known state.
u. Process substitution is now available in posix mode.
v. READLINE_MARK: a new variable available while executing commands bound with
`bind -x', contains the value of the mark.
w. Bash removes SIGCHLD from the set of blocked signals if it's blocked at shell
startup.
x. `test -v N' can now test whether or not positional parameter N is set.
y. `local' now honors the `-p' option to display all local variables at the
current context.
z. The `@a' variable transformation now prints attributes for unset array
variables.
aa. The `@A' variable transformation now prints a declare command that sets a
variable's attributes if the variable has attributes but is unset.
bb. `declare' and `local' now have a -I option that inherits attributes and
value from a variable with the same name at a previous scope.
cc. When run from a -c command, `jobs' now reports the status of completed jobs.
dd. New `U', `u', and `L' parameter transformations to convert to uppercase,
convert first character to uppercase, and convert to lowercase,
respectively.
ee. PROMPT_COMMAND: can now be an array variable, each element of which can
contain a command to be executed like a string PROMPT_COMMAND variable.
ff. `ulimit' has a -R option to report and set the RLIMIT_RTTIME resource.
gg. Associative arrays may be assigned using a list of key-value pairs within
a compound assignment. Compound assignments where the words are not of
the form [key]=value are assumed to be key-value assignments. A missing or
empty key is an error; a missing value is treated as NULL. Assignments may
not mix the two forms.
hh. New `K' parameter transformation to display associative arrays as key-
value pairs.
ii. Writing history to syslog now handles messages longer than the syslog max
length by writing multiple messages with a sequence number.
jj. SECONDS and RANDOM may now be assigned using arithmetic expressions, since
they are nominally integer variables. LINENO is not an integer variable.
kk. Bash temporarily suppresses the verbose option when running the DEBUG trap
while running a command from the `fc' builtin.
ll. `wait -n' now accepts a list of job specifications as arguments and will
wait for the first one in the list to change state.
mm. The associative array implementation can now dynamically increase the
size of the hash table based on insertion patterns.
nn. HISTFILE is now readonly in a restricted shell.
oo. The bash malloc now returns memory that is 16-byte aligned on 64-bit
systems.
pp. If the hash builtin is listing hashed filenames portably, don't print
anything if the table is empty.
qq. GLOBIGNORE now ignores `.' and `..' as a terminal pathname component.
rr. Bash attempts to optimize away forks in the last command in a function body
under appropriate circumstances.
ss. The globbing code now uses fnmatch(3) to check collation elements (if
available) even in cases without multibyte characters.
tt. The `fg' and `bg' builtins now return an error in a command substitution
when asked to restart a job inherited from the parent shell.
uu. The shell now attempts to unlink all FIFOs on exit, whether a consuming
process has finished with them or not.
vv. There is a new contributed loadable builtin: asort.
2. New Features in Readline
a. If a second consecutive completion attempt produces matches where the first
did not, treat it as a new completion attempt and insert a match as
appropriate.
b. Bracketed paste mode works in more places: incremental search strings, vi
overstrike mode, character search, and reading numeric arguments.
c. Readline automatically switches to horizontal scrolling if the terminal has
only one line.
d. Unbinding all key sequences bound to a particular readline function now
descends into keymaps for multi-key sequences.
e. rl-clear-display: new bindable command that clears the screen and, if
possible, the scrollback buffer (bound to emacs mode M-C-l by default).
f. New active mark and face feature: when enabled, it will highlight the text
inserted by a bracketed paste (the `active region') and the text found by
incremental and non-incremental history searches. This is tied to bracketed
paste and can be disabled by turning off bracketed paste.
g. Readline sets the mark in several additional commands.
h. Bracketed paste mode is enabled by default.
i. Readline tries to take advantage of the more regular structure of UTF-8
characters to identify the beginning and end of characters when moving
through the line buffer.
j. The bindable operate-and-get-next command (and its default bindings) are
now part of readline instead of a bash-specific addition.
k. The signal cleanup code now blocks SIGINT while processing after a SIGINT.
- Fix build on musl-libc platforms (#49)
- Default CFLAGS of -g -O2 if user didn't specify any
- Fix a bug on Linux systems (#48)
- Add an OKSH_VERSION variable that gives the user the oksh version
(KSH_VERSION and SH_VERSION are still their original values)
- Default to ST_MTIM when using --no-thanks
- Allow some code to be commented out when not compiling with curses
Changelog from AN-2020-11-04:
- Makefile system: include/schily/nlsdefs.h no longer by default defines
the macro __() because this is in conflict with definitions that are
present in the system include files from newer HP-UX versions.
Thanks to Rudi Blom for reporting.
- Bourne Shell: If a background job did finish during an implicit wait
for a foreground job, the exit code for the background job was lost.
This was caused by a forgotten call to statjob(jp, &si, 0, 0) in
the function waitjob();
Thanks to Koichi Nakashima for reporting.
- Bourne Shell: The changes from 2020-10-09 to keep the exit code from
jobs like "(sleep 10; exit 17)&" in the job list, caused a command like
cat /etc/termcap |more
to stop after the first page of output because "more" died from trying
to read the answer for continuing the output as it was not in the
current foreground process group from the tty. This was the result of
a forgotten call to monitor = ismonitor(xflags); in xec.c
- Bourne Shell: The changes from 2020-10-09 to keep the exit code from
jobs like "(sleep 10; exit 17)&" could cause some wait commands to hang
infinitely because the job list had an endless loop. The new code
avoids to create the endless loop in the job list.
Thanks to Koichi Nakashima for reporting.
- Bourne Shell: The changes for jobcontrol in schily-2020-10-09 could.
cause bosh to dump core with the builtin fg(1) command because "thisjob".
was a NULL pointer.
We add a new lastthisjob variable to work around this problem.
Thanks for Noci Sonack for reporting.
- bsh/Bourne Shell: str2sig() has been enhanced to support e.g.
RTMIN+20 or RTMAX-20 as alias on platforms with 30 RT signals.
Note that this currently only works on non-POSIX platforms like Linux
where our private implementation is used. On Solaris, this would need
to wait until compatibility to POSIX issue 8 has been implemented
in the libc from Solaris.
Changelog from AN-2020-11-25:
- Makefile System: Added support for MacOS on arm64
Thanks to a hint from Ryan Schmidt from macports
Note that due to outstanding replies to recent changes in configure,
it could up to now not be verified that all configure tests now work in
a way that results in correct overall results. See below for an in
depth report on the changes.
- Makefile System: autoconf (config.guess & config.sub) now supports
the new arm64 Apple systems.
Thanks to Ryan Schmidt from macports for provinding the needed uname(1)
output.
- Makefile System: Added a new shell script "autoconf/uname" that helps
to create shell scrips that allow to emulate an alien host system in
order to test the correct behavior of configure.guess and configure.sub
on the main development platform.
This helps to adapt configure.guess and configure.sub to new platforms
in the future.
- Makefile System: The new clang compiler as published with the upcomming
ARM macs has been preconfigured with
-Werror -Wimplicit-function-declaration
as the default behavior and thus is in conflict with the existing base
assumption of the autoconf system that minimalistic C-code used for
compile/link allows to check for the existence of a specific function
in libc without a need to know which system #include file is used to
define a prototype for that function.
This clang version, as a result of this default, behaves like a C++
compiler and aborts if a function is used with no previous function
prototype. This caused most of the existing autoconf test to fail with
error messages about missing prototypes.
We implemented a workaround using these methods for the identified
problems:
- Most of the exit() calls in the various main() functions have
been replaced by return() to avoid a need to
#include <stdlib.h> in special since these test may be the
case for layered tests that #include files from the higher
level parts.
- Many autoconf tests programs now #include more system include
files, e.g. stdlib.h and unistd.h to avoid missing prototype
errors. This cannot reliably be done in tests that are used as
a base for higher level tests where the high level test
#includes own system include files, since older platforms do
not support to #include the same file twice.
So this is tricky...
- A test for a Linux glibc bug caused by incorect #pragma weak
usage inside glibc that prevents one or more functions from
ecvt()/fcvt()/gcvt() from being usable outside glibc now uses
hand-written prototypes for some of the libc interface
functions in order to avoid using the system includes. If we
did not do that, we could not use ecvt()/fcvt()/gcvt() on
MacOS anymore.
Thanks to Ryan Schmidt from macports for reporting and for the given
help that was needed for remote debugging.
Please send the needed feedback on whether the current state of the
configure script results on correct autoconf results on the M1 Macs.
Changelog from AN-2020-11-04:
- Makefile system: include/schily/nlsdefs.h no longer by default defines
the macro __() because this is in conflict with definitions that are
present in the system include files from newer HP-UX versions.
Thanks to Rudi Blom for reporting.
- Bourne Shell: If a background job did finish during an implicit wait
for a foreground job, the exit code for the background job was lost.
This was caused by a forgotten call to statjob(jp, &si, 0, 0) in
the function waitjob();
Thanks to Koichi Nakashima for reporting.
- Bourne Shell: The changes from 2020-10-09 to keep the exit code from
jobs like "(sleep 10; exit 17)&" in the job list, caused a command like
cat /etc/termcap |more
to stop after the first page of output because "more" died from trying
to read the answer for continuing the output as it was not in the
current foreground process group from the tty. This was the result of
a forgotten call to monitor = ismonitor(xflags); in xec.c
- Bourne Shell: The changes from 2020-10-09 to keep the exit code from
jobs like "(sleep 10; exit 17)&" could cause some wait commands to hang
infinitely because the job list had an endless loop. The new code
avoids to create the endless loop in the job list.
Thanks to Koichi Nakashima for reporting.
- Bourne Shell: The changes for jobcontrol in schily-2020-10-09 could.
cause bosh to dump core with the builtin fg(1) command because "thisjob".
was a NULL pointer.
We add a new lastthisjob variable to work around this problem.
Thanks for Noci Sonack for reporting.
- bsh/Bourne Shell: str2sig() has been enhanced to support e.g.
RTMIN+20 or RTMAX-20 as alias on platforms with 30 RT signals.
Note that this currently only works on non-POSIX platforms like Linux
where our private implementation is used. On Solaris, this would need
to wait until compatibility to POSIX issue 8 has been implemented
in the libc from Solaris.
Changelog from AN-2020-11-25:
- Makefile System: Added support for MacOS on arm64
Thanks to a hint from Ryan Schmidt from macports
Note that due to outstanding replies to recent changes in configure,
it could up to now not be verified that all configure tests now work in
a way that results in correct overall results. See below for an in
depth report on the changes.
- Makefile System: autoconf (config.guess & config.sub) now supports
the new arm64 Apple systems.
Thanks to Ryan Schmidt from macports for provinding the needed uname(1)
output.
- Makefile System: Added a new shell script "autoconf/uname" that helps
to create shell scrips that allow to emulate an alien host system in
order to test the correct behavior of configure.guess and configure.sub
on the main development platform.
This helps to adapt configure.guess and configure.sub to new platforms
in the future.
- Makefile System: The new clang compiler as published with the upcomming
ARM macs has been preconfigured with
-Werror -Wimplicit-function-declaration
as the default behavior and thus is in conflict with the existing base
assumption of the autoconf system that minimalistic C-code used for
compile/link allows to check for the existence of a specific function
in libc without a need to know which system #include file is used to
define a prototype for that function.
This clang version, as a result of this default, behaves like a C++
compiler and aborts if a function is used with no previous function
prototype. This caused most of the existing autoconf test to fail with
error messages about missing prototypes.
We implemented a workaround using these methods for the identified
problems:
- Most of the exit() calls in the various main() functions have
been replaced by return() to avoid a need to
#include <stdlib.h> in special since these test may be the
case for layered tests that #include files from the higher
level parts.
- Many autoconf tests programs now #include more system include
files, e.g. stdlib.h and unistd.h to avoid missing prototype
errors. This cannot reliably be done in tests that are used as
a base for higher level tests where the high level test
#includes own system include files, since older platforms do
not support to #include the same file twice.
So this is tricky...
- A test for a Linux glibc bug caused by incorect #pragma weak
usage inside glibc that prevents one or more functions from
ecvt()/fcvt()/gcvt() from being usable outside glibc now uses
hand-written prototypes for some of the libc interface
functions in order to avoid using the system includes. If we
did not do that, we could not use ecvt()/fcvt()/gcvt() on
MacOS anymore.
Thanks to Ryan Schmidt from macports for reporting and for the given
help that was needed for remote debugging.
Please send the needed feedback on whether the current state of the
configure script results on correct autoconf results on the M1 Macs.
- Solaris has a function named sig2str. Rename ours oksh_sig2str.
- Pull in latest upstream code, which is #43 from Michael Forney.
- Make BINDIR and MANDIR actually depend on PREFIX.
- Variables have $'s.
- Older Linux has clock_gettime in librt; check for that.
- configure: improve clock_gettime diagnostic messages.
- HP-UX support.
- Add --enable-lto for those who want link-time optimization.
- Update to latest OpenBSD code.
- Make cross compiling a real possibility, with instructions.
- Fix typo.
- For loop initial declarations is a better C99 check for older gcc.
- Update from OpenBSD.
- Separate out compilation and linking in configure tests.
- Only add -std=gnu99 if using --no-thanks.
- If using --no-thanks and you didn't specify the environment
- --no-thanks isn't just for cross compiling
- Default to ST_MTIM when using --no-thanks
New features with AN-2020-09-04:
- autoconf: congig.guess: FreeBSD on 64 bit ARM returns arm64 from
uname -m; this was previously not supported and rejected by config.sub.
We now convert "arm64" into "aarch64" in config.guess to get the usual
expected results.
- Makefile system: RULES/rules.env The environment variables FIGNORE,
LD_LIBRARY_PATH LD_LIBRARY_PATH_32 and LD_LIBRARY_PATH_64 are now
unexported from the enviroment.
In special FIGNORE is dangerous, as it is frequently used by bash
users but tells ksh93 to modify it's behavior with "echo *" and
this may cause strange things with our makefiles in case that
/bin/sh is ksh92. This applies e.g. to Oracle Solaris 11 and
OpenSolaris.
- Bourne Shell: added $(RM) -f $(DEST_DIR)$(INSBASE)/xpg4/bin/bosh
to the Makefile in the commands before creating the symlink
xpg4/bin/bosh to bosh to permit to call "make install" more than
once without causing an error.
- Bourne Shell: version.h now contains a new version date.
New features with AN-2020-10-09:
- autoconf: Added support for newer HP-UX versions on Itanium.
Thanks to Rudi Blom for reporting and making a change proposal.
- Bourne Shell: The "wait" builtin is now POSIX compliant and returns 127
in $? in case that a process id to be waited for does not exist.
- Bourne Shell: The exit code retrieved by $/ no longer is masked by 0xFF
when this code originates from a wait(1) call.
Thanks to Koichi Nakashima for reporting
- Bourne Shell: The man page has been enhanced for a better description
of the exit code constraitns.
Thanks to Koichi Nakashima for reporting
- Bourne Shell: The exit code from background jobs is now kept until
the builtin wait(1) is called.
Note that this introduces the need to call "wait" from time to time
in order to free shell job management resources.
Thanks to Koichi Nakashima for reporting
- Bourne Shell: The changes to keep exit codes for background jobs
caused problems that triggered a SIGSEGV in the shell with jobs like:
(sleep 10; exit 17)&
This needed a restructuring in the job management implementation.
- Bourne Shell: Since the next POSIX standard will make it optional
whether sig2str() and str2sig() deal with entries for "EXIT" / 0,
we enhanced the trap2str() and str2trap() interfaces to handle
"EXIT" / 0 and now call these functions before sig2str() and
str2sig().
- Bourne Shell: a new version date has been created.
New features with AN-2020-09-04:
- autoconf: congig.guess: FreeBSD on 64 bit ARM returns arm64 from
uname -m; this was previously not supported and rejected by config.sub.
We now convert "arm64" into "aarch64" in config.guess to get the usual
expected results.
- Makefile system: RULES/rules.env The environment variables FIGNORE,
LD_LIBRARY_PATH LD_LIBRARY_PATH_32 and LD_LIBRARY_PATH_64 are now
unexported from the enviroment.
In special FIGNORE is dangerous, as it is frequently used by bash
users but tells ksh93 to modify it's behavior with "echo *" and
this may cause strange things with our makefiles in case that
/bin/sh is ksh92. This applies e.g. to Oracle Solaris 11 and
OpenSolaris.
- Bourne Shell: added $(RM) -f $(DEST_DIR)$(INSBASE)/xpg4/bin/bosh
to the Makefile in the commands before creating the symlink
xpg4/bin/bosh to bosh to permit to call "make install" more than
once without causing an error.
- Bourne Shell: version.h now contains a new version date.
New features with AN-2020-10-09:
- autoconf: Added support for newer HP-UX versions on Itanium.
Thanks to Rudi Blom for reporting and making a change proposal.
- Bourne Shell: The "wait" builtin is now POSIX compliant and returns 127
in $? in case that a process id to be waited for does not exist.
- Bourne Shell: The exit code retrieved by $/ no longer is masked by 0xFF
when this code originates from a wait(1) call.
Thanks to Koichi Nakashima for reporting
- Bourne Shell: The man page has been enhanced for a better description
of the exit code constraitns.
Thanks to Koichi Nakashima for reporting
- Bourne Shell: The exit code from background jobs is now kept until
the builtin wait(1) is called.
Note that this introduces the need to call "wait" from time to time
in order to free shell job management resources.
Thanks to Koichi Nakashima for reporting
- Bourne Shell: The changes to keep exit codes for background jobs
caused problems that triggered a SIGSEGV in the shell with jobs like:
(sleep 10; exit 17)&
This needed a restructuring in the job management implementation.
- Bourne Shell: Since the next POSIX standard will make it optional
whether sig2str() and str2sig() deal with entries for "EXIT" / 0,
we enhanced the trap2str() and str2trap() interfaces to handle
"EXIT" / 0 and now call these functions before sig2str() and
str2sig().
- Bourne Shell: a new version date has been created.
ShellCheck is a GPLv3 tool that gives warnings and suggestions for
bash/sh shell scripts.
The goals of ShellCheck are:
* To point out and clarify typical beginner's syntax issues that cause
a shell to give cryptic error messages.
* To point out and clarify typical intermediate level semantic problems
that cause a shell to behave strangely and counter-intuitively.
* To point out subtle caveats, corner cases and pitfalls that may cause
an advanced user's otherwise working script to fail under future
circumstances.
New features with AN-2020-07-18:
- Bourne Shell: A new symlink from /opt/schily/xpg4/bin/bosh to
/opt/schily/xpg4/bin/sh is created when "smake install" is called.
This helps people to call "bosh" in strict POSIX mode using the
command line name "bosh" by putting /opt/schily/xpg4/bin in PATH
before /opt/schily/bin, where the bosh implements better backwards
cmpatibility to the Bourne Shell by default than a strictly POSIX
compliant bosh would do. /opt/schily/xpg4/bin/bosh behaves the same
as "/opt/schily/bin/bosh -o posix".
Thanks to Koichi Nakashima for reporting.
New features with AN-2020-08-12:
- autoconf: added a new test for the existence of <sys/auxv.h>
- autoconf: added new tests for Linux getauxval() and FreeBSD elf_aux_info()
- libschily: getexecpath.c now uses getauxval() on Linux and elf_aux_info()
on FreeBSD. This was needed since readlink("/proc/curproc/file") on
FreeBSD returns random values for hardlinked files, making it impossible
to use the result in order to find out which behavior variant of a
fat binary is requested.
- Bourne Shell: Several #ifdef SIG* have been added to make it compile
on older UNIX versions.
Thanks to a hint from Albert Wik.
New features with AN-2020-07-18:
- Bourne Shell: A new symlink from /opt/schily/xpg4/bin/bosh to
/opt/schily/xpg4/bin/sh is created when "smake install" is called.
This helps people to call "bosh" in strict POSIX mode using the
command line name "bosh" by putting /opt/schily/xpg4/bin in PATH
before /opt/schily/bin, where the bosh implements better backwards
cmpatibility to the Bourne Shell by default than a strictly POSIX
compliant bosh would do. /opt/schily/xpg4/bin/bosh behaves the same
as "/opt/schily/bin/bosh -o posix".
Thanks to Koichi Nakashima for reporting.
New features with AN-2020-08-12:
- autoconf: added a new test for the existence of <sys/auxv.h>
- autoconf: added new tests for Linux getauxval() and FreeBSD elf_aux_info()
- libschily: getexecpath.c now uses getauxval() on Linux and elf_aux_info()
on FreeBSD. This was needed since readlink("/proc/curproc/file") on
FreeBSD returns random values for hardlinked files, making it impossible
to use the result in order to find out which behavior variant of a
fat binary is requested.
- Bourne Shell: Several #ifdef SIG* have been added to make it compile
on older UNIX versions.
Thanks to a hint from Albert Wik.
Take maintainership.
Changelog from AN-2020-07-01:
- Bourne Shell: A command like
bosh -c 'var=$({ echo value >&3; } 3>&1); echo $var'
Did not print "value" as expected, but rather bosh: 3: bad file number
This is related to the fact that curly brackets do not have an
own binary node type in the parsed output and the recursive parser
from the $(cmd) execution needs to reconstruct the text form
of a command tree. As a result, the command has been translated
into:
bosh -c 'var=$( echo value >&3 3>&1); echo $var'
and this caused the observed problem.
Note that this basic problem may not be finally fixed, so please
report in case that other commands with curly brackets together
with $(cmd) cause problems.
Thanks to Koichi Nakashima for reporting.
Take maintainership.
Changelog from AN-2020-07-01:
- Bourne Shell: A command like
bosh -c 'var=$({ echo value >&3; } 3>&1); echo $var'
Did not print "value" as expected, but rather bosh: 3: bad file number
This is related to the fact that curly brackets do not have an
own binary node type in the parsed output and the recursive parser
from the $(cmd) execution needs to reconstruct the text form
of a command tree. As a result, the command has been translated
into:
bosh -c 'var=$( echo value >&3 3>&1); echo $var'
and this caused the observed problem.
Note that this basic problem may not be finally fixed, so please
report in case that other commands with curly brackets together
with $(cmd) cause problems.
Thanks to Koichi Nakashima for reporting.
- Bourne Shell: Added a unit test for the bug above.
This fixes:
In certain cases, bash does not perform quoted null removal on patterns
that are used as part of word expansions such as ${parameter##pattern}, so
empty patterns are treated as non-empty
This can cause circular problems where the +INSTALL script requires the shell
itself, but also avoids issues trying to add to /etc/shells during bootstrap
where it may not be appropriate, or done outside of the context of where the
bootstrap tarball will finally be installed.
Users who use mksh as a bootstrap shell can simply add to /etc/shells manually
after installing or extracting the bootstrap as required.
While here remove unnecessary extra indents.
Two patches have been applied on top, both of which are stored in the
patches directory as manual-Build.sh and manual-funcs.c, to fix issues
on Darwin and SunOS that will be included in the next mksh release. The
binary mksh.ico file has been manually removed.
This paves the way for mksh to be used as an alternate bootstrap shell
instead of shells/pdksh, which has been unmaintained for many years and
has some known issues.
Initial bulk build results on Darwin and SunOS look good, and having a
maintained shell which focuses on portability and speed should provide
us with a better long-term option for systems which require a bootstrap
shell.
- Use OS specific helper code from devel/smake/Makefile.common
Changes from AN-2020-05-25:
- libmdgest: Added a "defined(_M_ARM)" check for MSVC byte order
definitions (byte_order.h).
Thanks to "Excalibur" for reporting.
- Bourne Shell: The support for the OLDPWD environment has been moved
from DO_SYSPUSHD to DO_POSIX_CD and as a result, the minimal POSIX
compile variant "pbosh" now supports "$OLDPWD" and "cd -".
This was based on a bug in the POSIX standard that did not include
OLDPWD in the overview of shell environment variables. See
https://www.austingroupbugs.net/view.php?id=1343
Thanks to Koichi Nakashima for reporting
- Use OS specific helper code from devel/smake/Makefile.common
Changes from AN-2020-05-25:
- libmdgest: Added a "defined(_M_ARM)" check for MSVC byte order
definitions (byte_order.h).
Thanks to "Excalibur" for reporting.
- Bourne Shell: The unit tests for the ERR trap did not work on NetBSD
because /bin/false does not exists on NetBSD. We now first check
for /bin/false and /usr/bin/false and use what's available.
Thanks to Michael Bäuerle from pkgsrc for reporting.
These packages are susceptible to bugs when confronted with non-ASCII
characters.
See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94182.
It takes some time to analyze and fix these individually, therefore they
are only marked as "needs work".
R59b is a must-have bugfix upgrade for R59 (not R58):
[tg] Handle other tmux $TERM types, pointed out by multi via IRC
[tg] Fix typo in FAQ
[tg] y='a\*b'; [[ $x = $y ]] regression (Martijn Dekker) fix
[l0kod] Defuse CLIP OS O_MAYEXEC support (cf. LWN)
[tg] Make set +o output a command to restore the currently set and (new!) cleared options, keep a reset state per session (experimental)
[tg] Correct documentation and code regarding to argv[0] parsing: first ‘-’ for login shells, then ‘r’ case-insensitively for restricted shell, then “sh”*, again case-insensitively, for BINSH_* modes; add tests
[tg] On OS/2, allow case-insensitive name for direct builtin call
[tg] Always skip startup files if direct builtin call
[tg] Avoid some sometimes-redundant startup codepaths
R59 has some major fixes, also introducing breaking changes:
[tg] Repair out-of-tree builds (noticed by rsc)
[tg] Work around a glibc on Hurd issue in testsuite
[komh] OS/2 filesystem mtime granularity is two seconds (as in FAT)
[tg] Replace while with goto: Coverity was confused
[tg] Fix invocation of some builtins when external utility absent
[komh] Improve automatic executable suffix for test builtin
[tg] Style code, refactor, clean up, optimise
[tg] Use cached egid in test builtin
[tg] Make bind builtin output reentry-safe; safety fixes
[tg] If basename(argv[0]) after leading dash removal begins with an ‘r’ enable restricted shell flag; reported by pmjdebruijn via IRC
[tg] Fix code example in manpage for how tab completion escapes
[tg] Match full extglob pattern RHS of [[ string comparison like ksh93
[tg] Implement which with -a in dot.mkshrc
[tg] Remove global builtin (use typeset -g)
[tg] alias, command, whence: Print alias names quoted
[tg] Implement a new quote-region (Esc+Q) editing command
[tg] Document all built-in aliases (requested by msiism via IRC) and those aliases and functions shipped in dot.mkshrc; completely overhaul builtin and reserved word documentation, for consistency
[tg] The manual page now features properly spaced em dashes ☻
[tg] Document that test x = y doesn’t extglob, only [[ x = y ]] does
R58 contains a lot of fixes and improvements:
[lintian] hyphen-used-as-minus-sign (on jessie, not later, ‽‽‽)
[tg] Fix system info gcc dump{machine,version} shell escaping level
[tg] Document KSH_VERSIONNAME_VENDOR_EXT in Build.sh
[tg] Be more explicit about the LTO bug exposed by check.t
[Todd C. Miller] Add -x (file locks) and AIX-specific -r ulimits
[tg] Handle Midipix as test environment and fix some warnings
[tg] Fix some Build.sh issues as Mirtoconf is now used by MirCPIO and MagicPoint
[komh] Improve CRLF to LF conversion
[komh] Ensure ECHO mode is enabled at startup so read has local echo
[komh] Let check.pl retain the PERLIO env variable
[komh] Unbreak nounset-1 test on systems with drive letters
[komh, tg] Make ulimit-3 test work without |& (that is, incomplete ports, i.e. those with -DMKSH_NOPROSPECTOFWORK)
[tg] Disable xxx-stat-1 test for now, fails when run as root
[tg] Drop Build.sh flags -c combine, -c lto
[Martijn Dekker] Exit 126 on execve(2) failure, not 1 (e.g. E2BIG)
[tg] Behave set and export/readonly-on-read-only-variables when run with command and command dot, bugreports by Martijn Dekker
[tg] dot.mkshrc: simplify; enhance (un)setting locale example
[tg, selk] Catch build errors earlier
[tg] Add -fno-lto (if GCC is detected) to CFLAGS and LDFLAGS
[tg] Limit HISTSIZE to 65535, as long pre-announced
[tg] Unbreak testsuite selftest-tty-absent for lksh
[tg] Begin work on support for neatcc (needs neatcc to evolve first)
[tg] Fix possibly not enough aligned access in struct job
[tg] Support going full setugid by running “set -p” once interactive
[tg] Document another (arcane, almost nowhere needed) definition
[tg] Improve code legibility and testsuite reliability and maintenance
[tg] Speed up trivial += cases (LP#1855167)
[tg] Some further code and memory optimisation and test coverage
[tg] Document that += is always string append (LP#1857702)
[tg] Fix “set -e appears active within eval but isn’t” reported by Martijn Dekker and another bug related to using set ±e inside eval
[tg] Handle parameter assignment in front of invocations of POSIX-style functions like ksh-style ones and external utilities; cf. Debian #935115
[tg] Fix bad memory access for invalid syntax (LP#1857828, LP#1857826)
[Brian Callahan] Update MALLOC_OPTIONS-using testcase for newer OpenBSD
[tg] Support lacc as compiler (just detecting, no change), thanks Brian
[tg] Share __IDSTRING with jupp
[tg] Update string comparison/pattern documentation
[tg, veedeeh] Document vi command line editing mode state better
[tg] Add FAQ2HTML.sh to convert mksh.faq to local valid XHTML+CSS
[tg] Correct backslash expansion documentation; caveat re. 16-bit UCS
[tg] Fix extra empty field on IFS-NWS trim expansion (Martijn Dekker)
[tg] Improve code performance, quality, robustness and correctness
[tg] Allow ${x:n} where n is an identifier (veedeeh)
[tg] Permit ‘+’ in alias names, but not leading (Aleksey Cheusov)
[tg] Fix here strings for $@ (LP#1857195), reported by jvdh
[multiplexd] Add vi mode PgDn, similar to PgUp doing history search
[tg] Build.sh fixup unreliable test -n/-z
[multiplexd] Correct documentation of vi mode @c
[tg] Update to UCD 13.0.0
[tg] Use nanoseconds in test -nt / -ot (LP#1855325)
# fish 3.1.2 (released April 29, 2020)
This release of fish fixes a major issue discovered in fish 3.1.1:
- Commands such as `fzf` and `enhancd`, when used with `eval`, would hang. `eval` buffered output too aggressively, which has been fixed (#6955).
If you are upgrading from version 3.0.0 or before, please also review the release notes for 3.1.1, 3.1.0 and 3.1b1 (included below).
---
# fish 3.1.1 (released April 27, 2020)
This release of fish fixes a number of major issues discovered in fish 3.1.0.
- Commands which involve `. ( ... | psub)` now work correctly, as a bug in the `function --on-job-exit` option has been fixed (#6613).
- Conflicts between upstream packages for ripgrep and bat, and the fish packages, have been resolved (#5822).
- Starting fish in a directory without read access, such as via `su`, no longer crashes (#6597).
- Glob ordering changes which were introduced in 3.1.0 have been reverted, returning the order of globs to the previous state (#6593).
- Redirections using the deprecated caret syntax to a file descriptor (eg `^&2`) work correctly (#6591).
- Redirections that append to a file descriptor (eg `2>>&1`) work correctly (#6614).
- Building fish on macOS (#6602) or with new versions of GCC (#6604, #6609) is now successful.
- `time` is now correctly listed in the output of `builtin -n`, and `time --help` works correctly (#6598).
- Exported universal variables now update properly (#6612).
- `status current-command` gives the expected output when used with an environment override - that is, `F=B status current-command` returns `status` instead of `F=B` (#6635).
- `test` no longer crashes when used with "`nan`" or "`inf`" arguments, erroring out instead (#6655).
- Copying from the end of the command line no longer crashes fish (#6680).
- `read` no longer removes multiple separators when splitting a variable into a list, restoring the previous behaviour from fish 3.0 and before (#6650).
- Functions using `--on-job-exit` and `--on-process-exit` work reliably again (#6679).
- Functions using `--on-signal INT` work reliably in interactive sessions, as they did in fish 2.7 and before (#6649). These handlers have never worked in non-interactive sessions, and making them work is an ongoing process.
- Functions using `--on-variable` work reliably with variables which are set implicitly (rather than with `set`), such as "`fish_bind_mode`" and "`PWD`" (#6653).
- 256 colors are properly enabled under certain conditions that were incorrectly detected in fish 3.1.0 (`$TERM` begins with xterm, does not include "`256color`", and `$TERM_PROGRAM` is not set) (#6701).
- The Mercurial (`hg`) prompt no longer produces an error when the current working directory is removed (#6699). Also, for performance reasons it shows only basic information by default; to restore the detailed status, set `$fish_prompt_hg_show_informative_status`.
- The VCS prompt, `fish_vcs_prompt`, no longer displays Subversion (`svn`) status by default, due to the potential slowness of this operation (#6681).
- Pasting of commands has been sped up (#6713).
- Using extended Unicode characters, such as emoji, in a non-Unicode capable locale (such as the `C` or `POSIX` locale) no longer renders all output blank (#6736).
- `help` prefers to use `xdg-open`, avoiding the use of `open` on Debian systems where this command is actually `openvt` (#6739).
- Command lines starting with a space, which are not saved in history, now do not get autosuggestions. This fixes an issue with Midnight Commander integration (#6763), but may be changed in a future version.
- Copying to the clipboard no longer inserts a newline at the end of the content, matching fish 2.7 and earlier (#6927).
- `fzf` in complex pipes no longer hangs. More generally, code run as part of command substitutions or `eval` will no longer have separate process groups. (#6624, #6806).
This release also includes:
- a number of changes to improve macOS compatibility with code signing and notarization;
- a number of improvements to completions; and
- a number of content and formatting improvements to the documentation.
If you are upgrading from version 3.0.0 or before, please also review the release notes for 3.1.0 and 3.1b1 (included below).
## Errata for fish 3.1
A new builtin, `time`, was introduced in the fish 3.1 releases. This builtin is a reserved word (like `test`, `function`, and others) because of the way it is implemented, and functions can no longer be named `time`. This was not clear in the fish 3.1b1 changelog.
tbl of NetBSD does not work, install man page with unprocessed tables as
workaround.
Changes from AN-2020-03-11:
- configure: The autoconfiguration now has an enhanced test for waitid()
that was needed since Mac OS is still not POSIX compliant and returns 0
instead of the signal number for a process that has been killed by a
signal. MacOS did pass the POSIX certification as a result of a missing
test for that problem.
Since every vertified OS needs to run an annual refresh the
certification with recent versions of the test, I guess that
Mac OS (Catalina updates) may become more compliant witin a year.
- psmake: The portable bootstrap compile environment for smake missed
a symlink for unsetenv.c to libschily since the related code has been
moved to libschily in 2018. This prevented compilation on IRIX.
Thanks to Kazuo Kuroi for reporting
- libshedit: mystdio.h now calls #undef sprintf and #undef snprintf
before redefining the names. This avoids clang warnings on MacOS.
- Bourne Shell: set -m now works in scripts as well. Before, bosh did
never call startjobs() when the shell startup was done with a shell
script.
- Bourne Shell: The shell now supports the alternate ;& switch
command limiter in addition to ;; where ;& implements a fallthrough
to the next command list regardless on thether there is a match or not.
- Bourne Shell: The file xec.c has been reindented for the "case" support
code in the interpreter. The indentation is now one tab less so code
becomes more readable.
- ved/bsh/bosh: map.c now includes better command for the routines that
implement fallback to some basic mapping when no user defined mapping
has been set up.
Changes from AN-2020-03-27:
- Bourne Shell: The case statement now supports the alternate end case
symbol ";;&" that has been introduced by bash. If ";;&" is used instead
of ";;", the next pattern list is evaluated and if there is a match,
the related command list is executed.
Changes from AN-2020-04-18:
- Bourne Shell: IRIX has ls(1) installed as /sbin/ls and this caused
some of our unit tests to fail. We now only check for "bin/ls" and
no longer for "/bin/ls" in "type" return messages.
- Bourne Shell/bsh: signames.c has been modified to work correctly if the
number of statically defined realtime signals is odd. This applies to
NetBSD and caused the shells to miss RTMIN+15 on NetBSD.
Thanks to Robert Elz for reporting
- Bourne Shell: A new trap code "ERR" as been introduced. This is modeled
after a feature from ksh88. "trap cmd ERR" causes "cmd" to be called
whenever a command causes a non-zero exit code. The "cmd" is not called
in case that with "set -e" the shell would not exit.
This is not required by POSIX but helpful.
- Bourne Shell: A new set of unit tests for the ERR trap has been added.
- Bourne Shell: An attempt to fix the POSIX behavior for set -e from
October 2018 has been identified to be wrong. If we kept that change,
a list with "set -e; ..." and a failing command would not exit as
expected.
- Bourne Shell: A new piece of code has been added to handle set -e
for function calls.
- Bourne Shell: The man page now better explains the behavior, if in
set -e mode.
- Bourne Shell: print.c::prs_cntl() could cause a buffer overflow with
"unprintable" multi byte UNICODE characters that are printed as list
of octal escape sequences. the buffer overflow happened because there
was only redzone space for one such octal escape sequence.
Thanks to Heiko Eißfeldt for reporting
Changes from AN-2020-05-11:
- Makefile system: A new version of the BSD make (bmake) program fixed
a bug in pattern macro substitution, so we are now able to detect
BSD make and to read BSD make program specific rules.
This could in theory allow us to support BSD make in the future,
but...
Note that we on the other side discovered a new bug with pattern
macro substitution in bsd make: The substitution:
$(FOO:%=bar/%)
is replaced by "bar/" with an empty "FOO", but of course, with an
empty FOO, the substitution should be empty as well.
This second bug (above) was fixed on May 6th, but we do not yet have
all needed make rules and we do not know whether other bugs may still
prevent the usability of BSD make. Supporting BSD make will be hard
as BSD make does not support pattern matching default rules and this
is important for placing the .o files into a sub-directory.
Also note that the portable program source for "bmake" from "pkgsrc"
is 2 years old and thus currently cannot be supported at all. If
you like to experiment on your own, you need to get this version:
http://crufty.net/help/sjg/bmake.html
see
http://www.crufty.net/ftp/pub/sjg/bmake.tar.gz
and replace the newer files from the netbsd.org CVS tree by hand in
order to fix the first and second mentioned pattern macro substitution
bug.
- Makefile system: RULES/MKLINKS was enhanced to create a new symlink
RULES/r-bsdmake.tag that points to RULES/r-make.tag
- Makefile system: The archive makefiles.tar.bz2 has been added to the
schilytools tree to allow easy reuse of the makefile system for own
projects.
- Bourne Shell: The unit tests for the new ERR trap did not work on
Solaris because /bin/false on Solaris causes an exit code of 255.
We now only check for an exit code != 0.
- Bourne Shell: Some of the unit tests for the trap command are now only
run in case that the SUT is "bosh".
- Bourne Shell: set -- now checks the '\0' character at the end of
the string "--". This fixes strange behavior with argument strings that
start with "--".
- Bourne Shell: Added a new flag XEC_INFUNC to the xflag parameter to mark
the fact when inside a function.
- Bourne Shell: set -e no longer causes commands with nonzero exit code
to abort inside a function in case that the return code of that function
is evaluated by e.g. an "if" statement.
Thanks to Koichi Nakashima for reporting
- Bourne Shell: A unit test for the above bug has been added.
- Bourne Shell: $- may no longer be partially wrong (and miss the state
of the -e flag).
Thanks to Koichi Nakashima for reporting
- Bourne Shell: under some rare conditions, the syntax tree -> cmdline
converter could omit a command delimiter. This was the result of the
fact that a helper variable "didnl" (used for codeoutput beautifying)
was not reset in func.c and thus could cause
printf a ; printf b
to print "aprintf b" instead of "ab"
Thanks to Koichi Nakashima for reporting
- Bourne Shell: A unit test for the above bug has been added.
- Bourne Shell: A command like:
command | while read name; do loopcmd; done
did stop after the first loop because "read" did then read from stdin
instead of using the pipe file descriptor. This happened only of
"loopcmd" was not a shell builtin.
Thanks to Koichi Nakashima for reporting
- Bourne Shell: A unit test for the above bug has been added.
- Bourne Shell: When we added support for ${var+value with spaces}
4 years ago, we forgot to enhance the lexer the same way for things
like "${var+value with spaces}" and "${var+"value with spaces"}".
This has been forgotten, because a different part of the lexer is
used to parse that kind of quoted strings. The lexer now supports
looking for closing '}' in quoted text as well.
Thanks to Koichi Nakashima for reporting
- Bourne Shell: A unit test for the above bug has been added.
- Bourne Shell: The expression "${var1#"$var2"}" has been introduced by
ksh88 with strange rules for the way the double quotes past # are
handled. We now support them....
Thanks to Koichi Nakashima for reporting
- Bourne Shell: A unit test for the above bug has been added.
- Bourne Shell: Some unit tests from "mksh" (that previously have been
disabled) have been enabled, since the two changes above now make
the Bourne Shell behave like "mksh" for these 6 additional tests.
Fixed path of true and false utilities for testsuite.
tbl of NetBSD does not work, install man page with unprocessed tables as
workaround.
Changes from AN-2020-03-11:
- configure: The autoconfiguration now has an enhanced test for waitid()
that was needed since Mac OS is still not POSIX compliant and returns 0
instead of the signal number for a process that has been killed by a
signal. MacOS did pass the POSIX certification as a result of a missing
test for that problem.
Since every vertified OS needs to run an annual refresh the
certification with recent versions of the test, I guess that
Mac OS (Catalina updates) may become more compliant witin a year.
- psmake: The portable bootstrap compile environment for smake missed
a symlink for unsetenv.c to libschily since the related code has been
moved to libschily in 2018. This prevented compilation on IRIX.
Thanks to Kazuo Kuroi for reporting
- libshedit: mystdio.h now calls #undef sprintf and #undef snprintf
before redefining the names. This avoids clang warnings on MacOS.
- Bourne Shell: set -m now works in scripts as well. Before, bosh did
never call startjobs() when the shell startup was done with a shell
script.
- Bourne Shell: The shell now supports the alternate ;& switch
command limiter in addition to ;; where ;& implements a fallthrough
to the next command list regardless on thether there is a match or not.
- Bourne Shell: The file xec.c has been reindented for the "case" support
code in the interpreter. The indentation is now one tab less so code
becomes more readable.
- ved/bsh/bosh: map.c now includes better command for the routines that
implement fallback to some basic mapping when no user defined mapping
has been set up.
Changes from AN-2020-03-27:
- Bourne Shell: The case statement now supports the alternate end case
symbol ";;&" that has been introduced by bash. If ";;&" is used instead
of ";;", the next pattern list is evaluated and if there is a match,
the related command list is executed.
Changes from AN-2020-04-18:
- Bourne Shell: IRIX has ls(1) installed as /sbin/ls and this caused
some of our unit tests to fail. We now only check for "bin/ls" and
no longer for "/bin/ls" in "type" return messages.
- Bourne Shell/bsh: signames.c has been modified to work correctly if the
number of statically defined realtime signals is odd. This applies to
NetBSD and caused the shells to miss RTMIN+15 on NetBSD.
Thanks to Robert Elz for reporting
- Bourne Shell: A new trap code "ERR" as been introduced. This is modeled
after a feature from ksh88. "trap cmd ERR" causes "cmd" to be called
whenever a command causes a non-zero exit code. The "cmd" is not called
in case that with "set -e" the shell would not exit.
This is not required by POSIX but helpful.
- Bourne Shell: A new set of unit tests for the ERR trap has been added.
- Bourne Shell: An attempt to fix the POSIX behavior for set -e from
October 2018 has been identified to be wrong. If we kept that change,
a list with "set -e; ..." and a failing command would not exit as
expected.
- Bourne Shell: A new piece of code has been added to handle set -e
for function calls.
- Bourne Shell: The man page now better explains the behavior, if in
set -e mode.
- Bourne Shell: print.c::prs_cntl() could cause a buffer overflow with
"unprintable" multi byte UNICODE characters that are printed as list
of octal escape sequences. the buffer overflow happened because there
was only redzone space for one such octal escape sequence.
Thanks to Heiko Eißfeldt for reporting
Changes from AN-2020-05-11:
- Makefile system: A new version of the BSD make (bmake) program fixed
a bug in pattern macro substitution, so we are now able to detect
BSD make and to read BSD make program specific rules.
This could in theory allow us to support BSD make in the future,
but...
Note that we on the other side discovered a new bug with pattern
macro substitution in bsd make: The substitution:
$(FOO:%=bar/%)
is replaced by "bar/" with an empty "FOO", but of course, with an
empty FOO, the substitution should be empty as well.
This second bug (above) was fixed on May 6th, but we do not yet have
all needed make rules and we do not know whether other bugs may still
prevent the usability of BSD make. Supporting BSD make will be hard
as BSD make does not support pattern matching default rules and this
is important for placing the .o files into a sub-directory.
Also note that the portable program source for "bmake" from "pkgsrc"
is 2 years old and thus currently cannot be supported at all. If
you like to experiment on your own, you need to get this version:
http://crufty.net/help/sjg/bmake.html
see
http://www.crufty.net/ftp/pub/sjg/bmake.tar.gz
and replace the newer files from the netbsd.org CVS tree by hand in
order to fix the first and second mentioned pattern macro substitution
bug.
- Makefile system: RULES/MKLINKS was enhanced to create a new symlink
RULES/r-bsdmake.tag that points to RULES/r-make.tag
- Makefile system: The archive makefiles.tar.bz2 has been added to the
schilytools tree to allow easy reuse of the makefile system for own
projects.
- Bourne Shell: The unit tests for the new ERR trap did not work on
Solaris because /bin/false on Solaris causes an exit code of 255.
We now only check for an exit code != 0.
- Bourne Shell: Some of the unit tests for the trap command are now only
run in case that the SUT is "bosh".
- Bourne Shell: set -- now checks the '\0' character at the end of
the string "--". This fixes strange behavior with argument strings that
start with "--".
- Bourne Shell: Added a new flag XEC_INFUNC to the xflag parameter to mark
the fact when inside a function.
- Bourne Shell: set -e no longer causes commands with nonzero exit code
to abort inside a function in case that the return code of that function
is evaluated by e.g. an "if" statement.
Thanks to Koichi Nakashima for reporting
- Bourne Shell: A unit test for the above bug has been added.
- Bourne Shell: $- may no longer be partially wrong (and miss the state
of the -e flag).
Thanks to Koichi Nakashima for reporting
- Bourne Shell: under some rare conditions, the syntax tree -> cmdline
converter could omit a command delimiter. This was the result of the
fact that a helper variable "didnl" (used for codeoutput beautifying)
was not reset in func.c and thus could cause
printf a ; printf b
to print "aprintf b" instead of "ab"
Thanks to Koichi Nakashima for reporting
- Bourne Shell: A unit test for the above bug has been added.
- Bourne Shell: A command like:
command | while read name; do loopcmd; done
did stop after the first loop because "read" did then read from stdin
instead of using the pipe file descriptor. This happened only of
"loopcmd" was not a shell builtin.
Thanks to Koichi Nakashima for reporting
- Bourne Shell: A unit test for the above bug has been added.
- Bourne Shell: When we added support for ${var+value with spaces}
4 years ago, we forgot to enhance the lexer the same way for things
like "${var+value with spaces}" and "${var+"value with spaces"}".
This has been forgotten, because a different part of the lexer is
used to parse that kind of quoted strings. The lexer now supports
looking for closing '}' in quoted text as well.
Thanks to Koichi Nakashima for reporting
- Bourne Shell: A unit test for the above bug has been added.
- Bourne Shell: The expression "${var1#"$var2"}" has been introduced by
ksh88 with strange rules for the way the double quotes past # are
handled. We now support them....
Thanks to Koichi Nakashima for reporting
- Bourne Shell: A unit test for the above bug has been added.
- Bourne Shell: Some unit tests from "mksh" (that previously have been
disabled) have been enabled, since the two changes above now make
the Bourne Shell behave like "mksh" for these 6 additional tests.
The README file has been renamed to README.md.
Since it is not installed anyway, there's no need to patch it.
If this need should ever arise again, the other paths in that file
should be patched as well.
Patch 16 was for this problem:
Bash waits too long to reap /dev/fd process substitutions used as redirections
with loops and group commands, which can lead to file descriptor exhaustion.
Patch 17 (this one):
There were cases where patch 16 reaped process substitution file descriptors
(or FIFOs) and processes to early. This is a better fix for the problem that
bash50-016 attempted to solve.
probably could do with an update).
Bosh changes (we skipped 2 intermediate releases):
New features with AN-2020-03-11:
- Bourne Shell: set -m now works in scripts as well. Before, bosh did
never call startjobs() when the shell startup was done with a shell
script.
- Bourne Shell: The shell now supports the alternate ;& switch
command limiter in addition to ;; where ;& implements a fallthrough
to the next command list regardless on thether there is a match or not.
New features with AN-2020-03-27:
- Bourne Shell: The case statement now supports the alternate end case
symbol ";;&" that has been introduced by bash. If ";;&" is used instead
of ";;", the next pattern list is evaluated and if there is a match,
the related command list is executed.
New features with AN-2020-04-18:
- Bourne Shell: IRIX has ls(1) installed as /sbin/ls and this caused
some of our unit tests to fail. We now only check for "bin/ls" and
no longer for "/bin/ls" in "type" return messages.
- Bourne Shell/bsh: signames.c has been modified to work correctly if the
number of statically defined realtime signals is odd. This applies to
NetBSD and caused the shells to miss RTMIN+15 on NetBSD.
Thanks to Robert Elz for reporting
- Bourne Shell: A new trap code "ERR" as been introduced. This is modeled
after a feature from ksh88. "trap cmd ERR" causes "cmd" to be called
whenever a command causes a non-zero exit code. The "cmd" is not called
in case that with "set -e" the shell would not exit.
This is not required by POSIX but helpful.
- Bourne Shell: A new set of unit tests for the ERR trap has been added.
- Bourne Shell: An attempt to fix the POSIX behavior for set -e from
October 2018 has been identified to be wrong. If we kept that change,
a list with "set -e; ..." and a failing command would not exit as
expected.
- Bourne Shell: A new piece of code has been added to handle set -e
for function calls.
- Bourne Shell: The man page now better explains the behavior, if in
set -e mode.
- Bourne Shell: print.c::prs_cntl() could cause a buffer overflow with
"unprintable" multi byte UNICODE characters that are printed as list
of octal escape sequences. the buffer overflow happened because there
was only redzone space for one such octal escape sequence.
Thanks to Heiko Eißfeldt for reporting