How is bash scripting affected by the bash4 release?
Asked Answered
S

2

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.

Sender answered 12/1, 2010 at 1:51 Comment(5)
shouldn't it be on superuser.com?Evitaevitable
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.Philomena
@Philomena - 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...Sender
@martin clayton - thanks, and +1 from me; I'm kind of interested too :)Philomena
Not an answer, but 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! :-)Prophylactic
P
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
Philomena answered 12/1, 2010 at 2:33 Comment(0)
S
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.

Sender answered 12/1, 2010 at 1:51 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.