6

bash4 looks good on paper, and I think I'll build it and give it a test drive.

In the meantime...

Anyone who has done the same care to share their expierence?

It would be particularly interesting to hear of any issues with old bash code.

martin clayton
  • 76,436
  • 32
  • 213
  • 198
  • shouldn't it be on superuser.com? – ariefbayu Jan 12 '10 at 02:16
  • Unless you can relate this to a programming topic ("how is bash scripting affected by the bash4 release?"), voting to close as belongs on superuser. – Tim Jan 12 '10 at 02:17
  • @Tim - done. I'm _mostly_ interested in the coding aspect - so I'd like to keep a coding question here. I'll post on superuser too. Unless the question gets migrated anyway... – martin clayton Jan 12 '10 at 02:22
  • @martin clayton - thanks, and +1 from me; I'm kind of interested too :) – Tim Jan 12 '10 at 02:24
  • Not an answer, but http://tldp.org/LDP/abs/html/bashver4.html has detailed information and list of changes in bash4. bash4 got C-style `case` statements too (no default `break`). In fact, you can even make it execute statements corresponding to non-matches in `case`. Take that, C! :-) – Alok Singhal Jan 12 '10 at 02:27

2 Answers2

2

The bash NEWS file, repro'd here with some summary, has some good info. Big new features include:

  • Associative arrays: name members in array using array[name], and access with ${array[name]}
  • The special ** glob pattern: match all files and "zero or more" directories
  • Co-processes: use the coproc keyword to spawn another process, then redirect its I/O to the currently existing shell (or another process, if you so desire)
  • Case-modifying expansions: match names without regard to character case
Tim
  • 59,527
  • 19
  • 156
  • 165
0

There is a compatibility document that covers all versions of bash through to 4.1.

Tightening up of POSIX compliance is one area where differences with version 3.2 have arisen.

martin clayton
  • 76,436
  • 32
  • 213
  • 198