After nearly three years of development, a new version of the GNU Bash command interpreter 5.3 has been released, which is used by default in most Linux distributions. At the same time, the readline 8.3 library, utilized in bash for command line editing, has also been released.
Key improvements include:
- New command substitution forms '${ command; }' and '${|command;}' have been implemented, allowing the capture of command output without spawning a separate child process and without using unnamed pipes. The results of command execution are returned as substitution results or written to the REPLY variable.
- A new variable GLOBSORT has been added, determining the sorting method for file path completion. For example, sorting by name (GLOBSORT=name), size (GLOBSORT=size), or modification time (GLOBSORT=mtime) can be chosen, and you can also specify either ascending (from smallest to largest) or descending (from largest to smallest) order (for example, with 'GLOBSORT=-size', the largest files will be shown first).
- The built-in command 'compgen' has been enhanced with the '-V varname' option to save generated completions in a variable instead of outputting them to standard output.
- The built-in command 'read' has been updated with the '-E' option, which utilizes the readline library with bash completion rules when entering data.
- The built-in command 'source' now includes the '-p PATH' option, allowing you to override the search path list in file paths (the specified value is used instead of the $PATH variable).
- The source code has been updated to use the C23 standard. The ability to build with compilers in 'K&R C' mode (the style corresponding to the description of the C language in the book 'The C Programming Language' by Kernighan and Ritchie) has been discontinued.
- Full compatibility with POSIX specifications has been ensured for the built-in command 'umask'.
- A new loadable command 'kv' has been added, which forms an associative array based on a set of data in 'key value' format.
- A new loadable command 'strptime' has been introduced, which converts a textual representation of date and time into epoch time (the number of seconds since January 1, 1970).
- A new loadable command 'fltexpr' has been added, allowing for floating-point arithmetic operations similar to the let command.
- A dynamically set variable BASH_MONOSECONDS has been added, which contains the current value of the system's monotonic clock that continuously increases, even when the time is changed backward.
- In POSIX mode, string comparisons in the 'test' command using the '' operators are now performed considering the current locale.
- In the 'bind -x' command, separating the key and the command invoked by a space is now permitted if the sequence is enclosed in double quotes.
- The new version of Readline introduces the 'search-ignore-case' option for case-insensitive history searching. A command 'export-completions' has been added for exporting word completion options for processing in other processes. The command 'execute-named-command' has been added to execute a command whose name is obtained from standard input.
Source: opennet.ru
