After twenty months of development, a new version of the GNU Bash command interpreter 5.2 has been released, which is used by default in most Linux distributions. At the same time, the release of the readline library 8.2, utilized in bash for command line editing, has been announced.
Key improvements include:
- The code for parsing command substitution constructs has been rewritten. The new implementation uses a recursive call to the bison parser and features improved syntax checking and earlier error detection in substitution constructs.
- Parsing and expansion of array indexes have been enhanced. It is now possible to use the "@" and "*" parameters in the built-in unset command to reset a key with a specified value instead of resetting the entire array.
- A new setting called "patsub_replacement" has been added, which allows the character "&" in the replacement string to be used for substituting a part of the string that matches the specified pattern. To insert the literal "&", it must be escaped with a backslash.
- The number of situations where additional processes are not forked has been extended; for instance, fork is no longer applied when using the construct "$(<file)$."
- A new internal framework for timers and timeout calculations has been implemented.
- The opportunity to enable an alternative implementation of arrays during the build process (configure —enable-alt-array-implementation) has been provided, which is optimized for maximum access speed at the cost of increased memory usage.
- The use of substitutes $’…’ and $»…’, used in localization, has been expanded. The noexpand_translations setting and the build option "configure —enable-translatable-strings" have been added to control enabling support for localizable substitutes $»…$.
- A new setting called "globskipdots" has been added and enabled by default, prohibiting the return of “.” and “..” when expanding paths.
Source: opennet.ru
