Articles on Shell

Defensive Shell Scripting with Shell Options
Nov 24, 2025 · 10 min read
Unlike typical programming languages, Bash doesn't terminate when it encounters a variety of exceptions.

Installing Old Homebrew Cask Versions
Oct 4, 2025 · 5 min read
Homebrew makes it very difficult to install older versions of a cask.

Installing Old Homebrew Formula Versions
Aug 13, 2025 · 5 min read
Homebrew makes it very difficult to install older versions of a formula.

Resetting the Working Directory on Shell Function Exit
Jul 24, 2025 · 3 min read
Sometimes you need to change the working directory in a shell function. You should take care to reset it back after.

Reliably Detecting Command Existence in Bash
Dec 7, 2024 · 4 min read
You'll find quite a few different methods suggested on the internet, and they all have their own problems.

Resetting the Working Directory on Shell Script Exit
Mar 5, 2024 · 4 min read
Sometimes you need to change the working directory in a shell script. You should take care to reset it back after.

Automate Your macOS Default Settings
Feb 18, 2024 · 7 min read
You can use built-in CLI tools to apply your preferred macOS settings.

Bash Environment Variable Defaults
Apr 5, 2023 · 4 min read
Bash scripts can set defaults for environment variables that are optionally supplied at execution time.

Hash a String to a Number in Bash
Mar 5, 2023 · 2 min read
Sometimes you need to turn a stable string ID into a stable number ID, and it's relatively easy to do in Bash.

Automatically Execute Code Before & After Unix Commands
Jan 19, 2023 · 4 min read
It can be helpful to run some code automatically before or after calling a command, and it is easy to accomplish with shadowing functions.

Reliably Finding Executables in $PATH
Aug 27, 2021 · 4 min read
Most built-in commands commonly used to find executables in $PATH don't always work quite as expected, or are shell-specific.
