10

I was using bash3 up to now, and just got a copy of the latest version

$ ./bash --version
GNU bash, version 4.1.0(1)-release (i686-pc-linux-gnu)
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
$

What are the major changes/feature additions in version 4 over version 3?

1
  • 2
    As an aside, one can get the current running version of bash by typing Ctrl^xv Commented May 26, 2016 at 17:56

2 Answers 2

9

The NEWS file lists the features that were added in each version.

Most notably in 4.0 I see a couple of improvements to the autocompletion infrastructure, the (optional) addition of the ** glob operator, associative arrays and various syntactic shortcuts.

1
  • 1
    Also the autocd option — it doesn't look like much, but as a zsh user, it's what I miss most when I occasionally use bash (<4 or unconfigured). Commented Oct 23, 2010 at 21:41
3

Most importantly for the behavior of old scripts, the behavior with set -e has slightly changed, among other things for ( ...), [[ ... ]], and (( ... )).

The new behavior is said to be documented in the manual.

For example:

$ bash3 -ec '(false); echo $?'
1
$ bash4 -ec '(false); echo $?'
$ 

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.