Skip to content
Opsfolk

Programming and scripting, topic 9 of 78

Bash scripting

A shell script is the commands you would type, saved so they run the same way every time. Learn variables and quoting, if and for, functions, exit codes and $?, and reading arguments.

Start scripts with set -euo pipefail so they stop at the first error, quote every variable, and run ShellCheck on them. Past a hundred lines or so, a script usually wants to be a program in a real language.

On Opsfolk

Nothing of ours for this topic yet: an article is on its way.

Elsewhere

Your progress