• Shaarli
  • Tag cloud
  • Daily
  • RSS
  • Login
4500 shaares
Filters

Better Bash Scripting in 15 Minutes

QRCode

The tips and tricks below originally appeared as one of Google's "T esting on the Toilet" (TOTT) episodes. 

I start every bash script with the following prolog:

#!/bin/bash
set -o nounset
set -o errexit

Use functions

  • Favor $() over backticks (`)
  • Favor [[]] (double brackets) over []
  • Avoiding Temporary Files with <()
https://robertmuth.blogspot.com/2012/08/better-bash-scripting-in-15-minutes.html
October 14, 2026 at 10:34:00 AM EDT *
bash scripts linux
FILLER
Shaarli · The personal, minimalist, super fast, database-free, bookmarking service by the Shaarli community · Documentation
Fold Fold all Expand Expand all Are you sure you want to delete this link? Are you sure you want to delete this tag? The personal, minimalist, super fast, database-free, bookmarking service by the Shaarli community