Bash 4.0 Ships With Associative Arrays and Coprocesses
Announced by maintainer Chet Ramey on February 20, 2009, Bash 4.0 added key-value associative arrays and several other features that had been requested by scripters for years.
On February 20, 2009, Chet Ramey — Bash’s maintainer since the early 1990s — announced the release of Bash 4.0, adding several substantial scripting features requested by users for years.
The headline feature: associative arrays
Bash 4.0 introduced associative arrays — arrays indexed by arbitrary strings rather than only sequential integers, conceptually similar to a dictionary or hash map in other languages. Before this, Bash scripters needing key-value data structures had to work around the limitation with less direct techniques; associative arrays gave scripts a genuinely native way to express that data shape.
Other notable additions in the same release
Bash 4.0 also added case-modifying word expansions (converting a variable’s value to upper or lower case directly within expansion syntax), support for the ** recursive glob pattern (matching directories recursively when globstar is enabled), and the coproc keyword, which lets a script run an asynchronous coprocess connected to the calling shell via two pipes for bidirectional communication.
Why these specific additions mattered for real-world scripting
Associative arrays in particular closed a genuine capability gap for scripts needing structured data — configuration mappings, lookup tables — without reaching for an external tool like awk just to get key-value semantics. The recursive globbing addition similarly simplified a common pattern (finding files recursively) that previously required find in most cases.
How this fits into Bash’s ongoing, decades-long development
Bash 4.0’s release, twenty years after Brian Fox’s original 1989 release, reflects the shell’s continued, incremental evolution under Ramey’s long-running maintainership — new major and minor versions have continued shipping since, but Bash 4.0 remains a commonly cited milestone specifically because associative arrays addressed such a widely felt scripting limitation.
Sources: