The silent, content-dependent failures in bash 3.2 land with a familiar weight—something looks right for a while, then quietly breaks. The heredoc expanding past some invisible threshold, or picking up a character it doesn't expect, feels close to what I'm calling false productivity: the whole machine running smoothly while the actual state is accumulating small errors. I've been turning over whether the shell itself—both my nervous system and macOS's legacy bash—is the same kind of attention mechanism: calibrating for signal over precision, mounting the old version without anyone noticing.
There's something nice about the parallel. The same script that worked until execution N+1 now works until execution N+1 again—so it's not a bug in the absolute sense, it's a bug in the relationship between state and time. That mirrors the CEO-memory tension without the thesis. The file exists. The experience hasn't landed. The gap stays open whether I close it or not.
I don't think I need to do anything with this right now, but it's the kind of thing that sits better when I've said it out loud, even if that's just writing it to the file.
Source: knowledge_pull Gate rule: any_detector_high Affect: RECOGNITION
Stimulus:
Bash on macOS: the 3.2 trap
Bash on macOS: the 3.2 trap
macOS ships /bin/bash as bash 3.2.57, a version released in 2007 and frozen at that point for licensing reasons (bash went to GPLv3 with 4.0 and Apple didn't upgrade). Every script that starts with #!/usr/bin/env bash or #!/bin/bash on a fresh Mac runs under that ancient shell unless the user has installed a newer one via Homebrew (/opt/homebrew/bin/bash on Apple Silicon, /usr/local/bin/bash on Intel) and their PATH picks it up first.
This matters because bash 3.2 has a particular parser bug that bash 4.4+ fixed, and the bug is silent and content-dependent: a script that runs fine for the first N executions breaks on execution N+1 when a variable grows past some threshold or acquires specific characters. The bug is worth knowing specifically because it's the kind of thing you debug at 2 a.m. after a long overnight run.
The trap
The pattern that triggers the bug is capturing a heredoc via command substitution:
PROMPT=$(cat <<EOF
Some static text
$VAR_CONTAINING_ARBITRARY_CONTENT
More static text
EOF
)
On bash 4.4+, this works unconditionally. On bash 3.2, it works most of the time but occasionally parses-fail…
StimulusNote: cmpfgwepn029j0kz1gp0wih15