Listen "PBS 153 – Bash: Functions & Scope"
Episode Synopsis
In Programming By Stealth, we've come to the end of our journey with Bash. I'll be sad to have it complete because as I tell Bart in this episode, I've really enjoyed it. Next time he will do a final bow-tying episode where he brings everything we learned together in one set of notes as a handy reference guide.
In this episode, he explains how functions work in Bash, and after about the 12th time he repeated it, I understand that functions we create in Bash work just like built-in functions such as `ls` or `cat`.
After walking us through some easy-to-follow scripts to illustrate this and show us the syntax, we go into a harder concept: scope. We learn that Bash does scope differently from pretty much every other language, and so he teaches us how to avoid spooky action at a distance because of this different way of dealing with scope. Protecting ourselves isn't actually hard but it is very important to understand why we need to do this.
You can find Bart's fabulous tutorial shownotes at pbs.bartificer.net.
In this episode, he explains how functions work in Bash, and after about the 12th time he repeated it, I understand that functions we create in Bash work just like built-in functions such as `ls` or `cat`.
After walking us through some easy-to-follow scripts to illustrate this and show us the syntax, we go into a harder concept: scope. We learn that Bash does scope differently from pretty much every other language, and so he teaches us how to avoid spooky action at a distance because of this different way of dealing with scope. Protecting ourselves isn't actually hard but it is very important to understand why we need to do this.
You can find Bart's fabulous tutorial shownotes at pbs.bartificer.net.
More episodes of the podcast Programming By Stealth
PBS Tidbit 16 — How Podfeet.com Works
10/01/2026
PBS Tidbit 14 — Coding with AI
25/10/2025
PBS Tidbit 13 — PowerShell Tames Monty
19/07/2025
PBS 180 of X — Theming Jekyll
25/05/2025
PBS Tidbit 12 — XKPasswd Rewrite Exits Beta
23/04/2025
ZARZA We are Zarza, the prestigious firm behind major projects in information technology.