
TestingGuide
Testing Shell Scripts With Bats and ShellCheck in Practice
Test shell scripts with Bats and ShellCheck: write tests, mock commands, test functions, run in CI and containers, and catch quoting bugs before they ship.
36 min read
Everything you need to level up your coding skills.

Test shell scripts with Bats and ShellCheck: write tests, mock commands, test functions, run in CI and containers, and catch quoting bugs before they ship.

A practical shell script security guide: quoting, option injection, eval, temp files, PATH, secrets, sudo and least privilege, with attacks run and fixed.

Write portable shell scripts that run on dash, BusyBox and Bash: what POSIX sh allows, which Bashisms to drop, and how to test on each shell.

A complete Bash scripting tutorial: variables, quoting, tests, loops, functions, arrays, exit codes, traps and a finished backup script you can trust.
One email when a new post is published. No spam.