Submission timeline
2007–2026One slot for every year since HN launched. Height is that year's peak points; orange marks a 100+ point or 50+ comment breakout. Select a bar to open its strongest thread.
First comments on top threads
HN comment orderIt's still relevant if you use -a, -o, or parentheses (which I guess is reason to avoid them): $ a=1; b=1; c='!'; d='!' $ [ "$a" = "$b" -a "$c" = "$d" ] -bash: [: too many arguments $ [ '!' '(' "$c" = "$d" ')' ] -bash: [: `)' expected, found ! $ echo "${BASH_VERSION}" 5.1.4(1)-release Note that it's not even a bug here; it's necessary for disambiguation.
Discussed extensively last year: https://news.ycombinator.com/item?id=26776956 One key point there is that it’s still easy to trigger cases where you need this hack, because the cleverness is only stable for up to four arguments; so and, or, and parentheses all exceed the point of safety.
[ wasn't an operator or language construct but an external program similar or the same as test. ] was a final argument. In today's world where bash is and does supplant POSIX for all intents and purposes, use [[ and (( because they're part of the interpreter and more flexible.
The first top-level comment from each of the four biggest threads, in HN’s own order. Excerpts are shortened; open a comment for full context.
- Breakout years
- 2
- Total points
- 753
- Total comments
- 436
100+ points or 50+ comments
reference only — not used in Hall rules or ranking
reference only — not used in Hall rules or ranking
Every submission
| Date | Title as submitted | By | Points | Comments |
|---|---|---|---|---|
| 2021-04-12 | What was the point of [ “x$var” = “xval” ]?First breakout · Best thread | JNRowe | 414 | 226 |
| 2023-03-04 | What was the point of [ “x$var” = “xval” ]? | pabs3 | 257 | 161 |
| 2024-09-28 | What was the point of [ "x$var" = "xval" ]? (2021)Latest 20+ point return | fanf2 | 82 | 49 |
