GNU Bash has been
in the low 2.0x series for some time, so the version jump to 3.0 last week
was something of a surprise, at least to those who haven't been following
Bash development closely. Since Bash is a core piece of infrastructure for
most of the Linux community, we decided to take a look at the 3.0 release
and find out what changed, and what users could expect from the new
release.
To that end, we touched base with Bash maintainer
Chet Ramey,
who was kind enough to reply to our questions about the latest release. The
first question on our mind, of course, was "why the version bump?"
You have to look at the changes from 2.05 to 3.0, not any of the
intermediate releases. The idea was to introduce major changes in
intermediate releases following bash-2.05, let them stabilize, and then
increment the major version.
The changes in 3.0 include support for the bash debugger and
internationalization support, as well as a number of smaller features that
had been requested for some time (time-stamped history entries, better
brace expansion) and better POSIX compliance. To that you add the
multibyte character support introduced in bash-2.05b and the code cleanups
and programming improvements in bash-2.05a.
The whole set of changes deserves a major version bump.
Indeed, there are quite a few changes in this release. A look at the
CHANGES file or the NEWS with the release
source shows a slew of bugfixes and changes to Bash and Readline.
One interesting new addition to Bash 3.0 is new type of brace
expansion. The syntax for the new brace expansion is {x..y} where x and y
can be an integer or a single character in ascending or descending
order. For example, the set {z..a} would match all of the letters from z to
a in descending order. (z,y,x, etc.) The set {1..1000} would match the each
of the integers from 1 to 1000.
Another new feature of interest is the addition of history timestamps. This
allows users to see when commands were run, which can provide some useful
and interesting information.
There are several new options with Bash 3.0. The "failglob" option will
probably be of interest to many users. When set, this option will cause an
error when a glob expression fails to match any files -- as opposed to
running the command anyway. The new "pipefail" option tells Bash to return
a failure status if any command in a "pipeline" fails, as opposed to the
default behavior of returning the status of the last job in a pipeline.
Of course, one might wonder if all of the improvements and changes in the
release will affect existing shell scripts. Many Bash users have a number
of shell scripts that are vital to our day to day work, this writer
included, and aren't eager to see them break on a new version of
Bash. According to the release notes, there are some incompatibilities
between 3.0 and Bash version 1.14, but no mention of 2.0x
versions. According to Ramey:
Any major incompatibilities are the result of changes for POSIX
compliance. There have not been comparable major additions to the shell's
syntax as there were between 1.14 and 2.0.
This writer has tried a number of shell scripts against the Bash 3.0
release, and didn't find any incompatibilities or issues. In fact, a
(permanent) switch to a Bash 3.0 login shell may be in my very near future.
We also asked Ramey what, if any, features were planned for future versions
of Bash. Ramey said that there were already plans for future releases
Programming support: associative arrays, better integration with the bash
debugger (a separate project), small improvements for programming
convenience (e.g., a += operator to append to a variable value), and some
object-oriented features like ksh's discipline functions for variables.
I'm intrigued by zsh's loadable module system as well.
As for interactive use, I think there's room for improvement in the
programmable completion system.
Readline needs better support for threaded use (multiple threads in a
single process all using separate instances of readline). This is very hard
to do today.
Interested users who don't want to wait for Bash to ship with their
favorite distribution can find the source on Ramey's Bash page, or
the GNU mirrors.
(
Log in to post comments)