The article demonstrates a Bash brace expansion one-liner that generates 30 English words (such as "when," "where," "then," "there," "hence," "henceforth," etc.) from a single nested brace pattern. The post then explains how the brace expansion tree works to produce those words.
Background
- **Brace expansion** is a feature in bash (the standard command-line shell on most Linux/macOS systems) that lets you generate multiple strings from a compact pattern. For example, `a{b,c}d` expands to `abd acd`. It is often used to shorten repetitive commands like `mkdir {2023,2024,2025}`.
- **John D. Cook** is a well-known applied mathematician and blogger who writes about math, computing, and programming curiosities. His posts often dissect clever or surprising code snippets.
- **Peter Krumins** (also known as "pkrumins") runs a blog (catonmat.net) that famously catalogues shell tricks, including the "Bash Brace Expansion" series that this one-liner comes from.
- The core idea here is that a single, carefully nested brace expression can encode a tree of word fragments — essentially a miniature grammar. The example generates 30 real English words (all variants of "wh-", "th-", "h-" adverbs and pronouns like "where", "whence", "hence", "therewithal") by expanding paths through that tree. This is a demonstration of how brace expansion is more powerful than it first appears: it is not just a list shortcut but a compact way to generate Cartesian products of string parts.
The article argues that self-driving cars will see rapid adoption once parents recognize that autonomous vehicles offer greater safety for their children compared to human-driven cars.
The article discusses the creative process and encourages readers to pursue meaningful work. It emphasizes that creating something good is achievable through dedication and persistence rather than waiting for perfect conditions.