Create an account


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bash Shell Utility Reaches 5.0 Milestone

#1
Bash Shell Utility Reaches 5.0 Milestone

As we look forward to the release of Linux Kernel 5.0 in the coming weeks, we can enjoy another venerable open source technology reaching the 5.0 milestone: the Bash shell utility. The GNU Project has launched the public version 5.0 of GNU/Linux’s default command language interpreter. Bash 5.0 adds new shell variables and other features and also repairs several major bugs.

New shell variables in Bash 5.0 include BASH_ARGV0, which “expands to $0 and sets $0 on assignment,” says the project. The EPOCHSECONDS variable expands to the time in seconds since the Unix epoch, and EPOCHREALTIME does the same, but with microsecond granularity.

New features include a “history -d” built-in function that can remove ranges of history entries and understands negative arguments as offsets from the end of the history list. There is also a new option called “localvar_inherit” that allows local variables to inherit the value of a variable with the same name at the nearest preceding scope.

A new shell option called “assoc_expand_once” causes the shell to attempt to expand associative array subscripts only once, which may be required when they are used in arithmetic expressions. Among many other new features, a new option is available that can disable sending history to syslog at runtime. In addition, the “globasciiranges” shell option is now enabled by default.

Bash 5.0 also fixes several major bugs. It overhauls how nameref variables resolve and fixes “a number of potential out-of-bounds memory errors discovered via fuzzing,” says the GNU Project’s readme. Changes have been made to the “expansion of $@ and $* in various contexts where word splitting is not performed to conform to a Posix standard interpretation.” Other fixes resolve corner cases for Posix conformance.

Finally, Bash 5.0 introduces a few incompatibilities compared to the most recent Bash 4.4.x. For example, changes to how nameref variables are resolved can cause different behaviors for some uses of namerefs.

Bash to basics


Bash (Bourne-Again Shell) may be 5.0 in development years, but it’s a lot older in Earth orbits. The utility will soon celebrate its 30th anniversary since Brian Fox released Bash 1.0 beta release in June 1989.

Over the years, Bash has expanded upon the POSIX shell spec with interactive command line editing, history substitution, brace expansion, and on some architectures, job control features. It has also borrowed features from the Korn shell (ksh) and the C shell (csh). Most sh scripts can be run by Bash without modification, says the GNU Project.

Bash and other Bourne-based shell utilities have largely survived the introduction of GUI alternatives to the command line such as Git GUI. Experienced Linux developers — and especially sysadmins — tend to prefer the greater speed and flexibility of working directly with the command line. There are also situations where the GUI will spit you back to the command line anyway.

It’s really a matter of whether you will be spending enough time doing Linux development or administration to make it worthwhile to learn the commands. Besides, in a movie, isn’t it more exciting to watch the hacker frantically clacking away at the command line to disable the nuclear weapon rather than clicking options off a menu? Clacking rules!

Bash 5.0 is available for download from the GNU Project’s Bash 5.0 readme page.

Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  CNCF Reaches 100 End User Community Members xSicKxBot 0 1,736 09-09-2023, 11:54 PM
Last Post: xSicKxBot
  Fedora - Customizing Bash xSicKxBot 0 1,650 07-03-2020, 02:38 AM
Last Post: xSicKxBot
  CNCF Reaches 100 End User Community Members xSicKxBot 0 1,606 06-05-2020, 02:00 PM
Last Post: xSicKxBot
  Fedora - Fish – A Friendly Interactive Shell xSicKxBot 0 1,662 03-10-2020, 09:21 AM
Last Post: xSicKxBot
  Fedora - Tuning your bash or zsh shell on Fedora Workstation and Silverblue xSicKxBot 0 1,788 11-07-2019, 07:43 PM
Last Post: xSicKxBot
  CNCF Reaches 100 End User Community Members xSicKxBot 0 1,653 10-23-2019, 01:44 PM
Last Post: xSicKxBot
  CNCF Reaches 100 End User Community Members xSicKxBot 0 1,721 09-11-2019, 12:49 AM
Last Post: xSicKxBot
  Fedora - Manage your shell environment xSicKxBot 0 1,561 07-05-2019, 11:23 AM
Last Post: xSicKxBot
  Fedora - Awk utility in Fedora xSicKxBot 0 1,606 04-30-2019, 03:21 AM
Last Post: xSicKxBot
  Using Square Brackets in Bash: Part 2 xSicKxBot 0 1,792 04-04-2019, 07:16 PM
Last Post: xSicKxBot

Forum Jump:


Users browsing this thread:

Forum software by © MyBB Theme © iAndrew 2016