After two years of development, a new version of the GNU Bash 5.1 shell has been released, which is the default on most Linux distributions. At the same time, the release of the readline 8.1 library was formed, used in bash to organize command line editing.
This is the default interpreter on many free Unix systems, especially on GNU / Linux systems. It is also the default shell of Mac OS X. The Cygwin project brought it to Windows for the first time and in Windows 10 it is an operating system option.
Main new features of Bash 5.1
The engine has been redesigned to generate pseudo-random numbers, Besides that se added SRANDOM variable A containing a 32-bit random number from the system's pseudo-random number generator.
For associative arrays, support for compound assignments is implemented, in which a set of pairs is passed in the key / value format, in addition to adding a dynamic increase in the size of a hash table depending on the type of data added to the associative array.
Another change that stands out is in the mode POSIX, the process substitution function is implemented, whereby the input and output of a command is treated as a file by other commands.
Were added new parameters for the conversion operators: "U", "u" and "L" to convert the entire string to uppercase, convert the first character to uppercase and convert to lowercase, as well as the parameter "K" to display an associative array in key / value format.
To enable backward compatibility mode, you now need to use the BASH_COMPAT variable (you cannot set bash 5.0 compatibility mode using the compat50 option).
By default, Readline has bracketed paste mode enabled, wherein the data retrieved from the clipboard is framed with escape sequences to visually highlight the data received from the clipboard. Readline provides highlighting for such inserts, as well as highlighting the text found during incremental and non-incremental history searches. The number of commands and situations for which highlighting labels are overridden has been expanded.
In addition, se returned the previous behavior related to the expansion of the file path when specifying words that include backslashes but they do not use special mask expansion characters.
As in bash 4.4, such routes are no longer disclosed (the modified behavior of Bash 5.0 was in accordance with the POSIX standard, but was negatively received by users and the POSIX committee agreed to change the specification). Also, the GLOBIGNORE mode now ignores the "." and ".." as path components specified in the terminal.
Modified exception handling when reading terminal data using the read and select constructs. The built-in select function now traps when a signal interrupts an internal call to read. Recursive launch allowed of SIGINT controllers.
Readline has implemented automatic horizontal scrolling on single line terminals.
In addition, we can find support to define different shortcut links keyboard for different editing modes and different keyboard layouts in the "bind -x" command.
The optimization of the number of branches was implemented executed when executing commands in the subshell or using "bash -c". When running "bash -c", the job execution status can now be found with the jobs command.
The pattern matching code now uses the fnmatch call to account for strings that look the same, but differ in character codes.
The command shell-transpose-words has been added to readline, using the same word definition as in shell-forward-word. By default, keyboard bindings were added for shell-forward-word, shell-backward-word, shell-transpose-words, and shell-kill-word.
How to get Bash 5.1 on Linux?
Moment It only remains to wait for this new version of Bash to be incorporated within the repositories of Linux distributions, since it is the best option.
If you want to know a little more and also those who want to get this new version now, you can visit the following link.