mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-06-28 16:09:51 +02:00
114 lines
4.7 KiB
Plaintext
114 lines
4.7 KiB
Plaintext
This is a terse description of the new features added to bash-5.0 since
|
|
the release of bash-4.4. As always, the manual page (doc/bash.1) is
|
|
the place to look for complete descriptions.
|
|
|
|
1. New Features in Bash
|
|
|
|
a. The `wait' builtin can now wait for the last process substitution created.
|
|
|
|
b. There is an EPOCHSECONDS variable, which expands to the time in seconds
|
|
since the Unix epoch.
|
|
|
|
c. There is an EPOCHREALTIME variable, which expands to the time in seconds
|
|
since the Unix epoch with microsecond granularity.
|
|
|
|
d. New loadable builtins: rm, stat, fdflags.
|
|
|
|
e. BASH_ARGV0: a new variable that expands to $0 and sets $0 on assignment.
|
|
|
|
f. When supplied a numeric argument, the shell-expand-line bindable readline
|
|
command does not perform quote removal and suppresses command and process
|
|
substitution.
|
|
|
|
g. `history -d' understands negative arguments: negative arguments offset from
|
|
the end of the history list.
|
|
|
|
h. The `name' argument to the `coproc' reserved word now undergoes word
|
|
expansion, so unique coprocs can be created in loops.
|
|
|
|
i. A nameref name resolution loop in a function now resolves to a variable by
|
|
that name in the global scope.
|
|
|
|
j. The `wait' builtin now has a `-f' option, which signfies to wait until the
|
|
specified job or process terminates, instead of waiting until it changes
|
|
state.
|
|
|
|
k. There is a define in config-top.h that allows the shell to use a static
|
|
value for $PATH, overriding whatever is in the environment at startup, for
|
|
use by the restricted shell.
|
|
|
|
l. Process substitution does not inherit the `v' option, like command
|
|
substitution.
|
|
|
|
m. If a non-interactive shell with job control enabled detects that a foreground
|
|
job died due to SIGINT, it acts as if it received the SIGINT.
|
|
|
|
n. The SIGCHLD trap is run once for each exiting child process even if job
|
|
control is not enabled when the shell is in Posix mode.
|
|
|
|
o. A new shopt option: localvar_inherit; if set, a local variable inherits the
|
|
value of a variable with the same name at the nearest preceding scope.
|
|
|
|
p. `bind -r' now checks whether a key sequence is bound before binding it to
|
|
NULL, to avoid creating keymaps for a multi-key sequence.
|
|
|
|
q. A numeric argument to the line editing `operate-and-get-next' command
|
|
specifies which history entry to use.
|
|
|
|
r. The positional parameters are now assigned before running the shell startup
|
|
files, so startup files can use $@.
|
|
|
|
s. There is a compile-time option that forces the shell to disable the check
|
|
for an inherited OLDPWD being a directory.
|
|
|
|
t. The `history' builtin can now delete ranges of history entries using
|
|
`-d start-end'.
|
|
|
|
u. The `vi-edit-and-execute-command' bindable readline command now puts readline
|
|
back in vi insertion mode after executing commands from the edited file.
|
|
|
|
v. The command completion code now matches aliases and shell function names
|
|
case-insensitively if the readline completion-ignore-case variable is set.
|
|
|
|
w. There is a new `assoc_expand_once' shell option that attempts to expand
|
|
associative array subscripts only once.
|
|
|
|
x. The shell only sets up BASH_ARGV and BASH_ARGC at startup if extended
|
|
debugging mode is active. The old behavior of unconditionally setting them
|
|
is available as part of the shell compatibility options.
|
|
|
|
y. The `umask' builtin now allows modes and masks greater than octal 777.
|
|
|
|
z. The `times' builtin now honors the current locale when printing a decimal
|
|
point.
|
|
|
|
aa. There is a new (disabled by default, undocumented) shell option to enable
|
|
and disable sending history to syslog at runtime.
|
|
|
|
2. New Features in Readline
|
|
|
|
a. Non-incremental vi-mode search (`N', `n') can search for a shell pattern, as
|
|
Posix specifies (uses fnmatch(3) if available).
|
|
|
|
b. There are new `next-screen-line' and `previous-screen-line' bindable
|
|
commands, which move the cursor to the same column in the next, or previous,
|
|
physical line, respectively.
|
|
|
|
c. There are default key bindings for control-arrow-key key combinations.
|
|
|
|
d. A negative argument (-N) to `quoted-insert' means to insert the next N
|
|
characters using quoted-insert.
|
|
|
|
e. New public function: rl_check_signals(), which allows applications to
|
|
respond to signals that readline catches while waiting for input using
|
|
a custom read function.
|
|
|
|
f. There is new support for conditionally testing the readline version in an
|
|
inputrc file, with a full set of arithmetic comparison operators available.
|
|
|
|
g. There is a simple variable comparison facility available for use within an
|
|
inputrc file. Allowable operators are equality and inequality; string
|
|
variables may be compared to a value; boolean variables must be compared to
|
|
either `on' or `off'; variable names are separated from the operator by
|
|
whitespace.
|