HN Hall of Fame Weekly email

Use the Unofficial Bash Strict Mode (Unless You Love Debugging)

redsymbol.net Books & learning Tutorials & guides Software engineering Candidate
Screenshot of redsymbol.net captured 2026-07-20
Page preview · captured 2026-07-20

Resurfaced independently across 10 calendar years, with breakout response in 2 of them.

submissions
17
submitters
17
observed span
2014–2025
peak thread · 57 comments
180 pts
latest 20+ return · 2025-08-22
48 pts

Submission timeline

2007–2026

One 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 order

The article is dangerously wrong in its discussion of IFS. What you should do to avoid the problem of mishandling spaces is use proper quoting (for i in "$@"; do ...), not changing IFS; setting IFS to \n\t will still break embedded tabs and newlines. In general, in bash scripts any of use of $ should always be between double quotes unless you have a reason to do otherwise.

devit·180-point thread·

Better than set -e is trapping ERR. You can set up a trap that prints out the command that failed, and the line it's on, rather than just dying quietly like set -e does. It's much easier to debug that than trying to work ahead from the last command with output. For bonus points, when you have a bunch of scripts together, put the trap code in its own file and source it in all the other scripts (rather than…

Stylistically, I much prefer #!/bin/bash set -o errexit set -o nounset set -o pipefail It reminds me when I wrote a lot of Perl: #!/usr/bin/perl use strict; use warnings; I also prefer --long --args everywhere possible and a comment on any short flag unless it's incredibly common. I've been writing all my Bash scripts like this for ~15 years and it's definitely the way to go.

The Bash FAQ disagrees: https://mywiki.wooledge.org/BashFAQ/105 The TFA is referenced at the bottom of this FAQ.

rkta·13-point thread·

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

100+ points or 50+ comments

Total points
400

reference only — not used in Hall rules or ranking

Total comments
150

reference only — not used in Hall rules or ranking

Every submission