Skip to main content
RunBook Academy

← All checklists in Linux

As neededCLI

Checklist: Shell script review

20 items ·9 critical ·7 warn ·4 info

This checklist is the pre-merge review for any shell script that will run in production — whether in a cron entry, a systemd timer, a CI pipeline, or a configuration-management run. Run it before the script reaches a production host for the first time.

Procedure

For each item:

  1. Read the requirement.
  2. Confirm the script satisfies it. If not, fix or document the exception.
  3. For automated checks, run the listed command and confirm the expected output.

The critical items are non-negotiable. A script missing any of them should not reach production until the gap is closed. Warnings should be addressed or explicitly justified in the pull request.

Approval

Every script merged to production should have:

  • A peer review confirming this checklist passes.
  • ShellCheck green at the configured severity in CI.
  • A test fixture that exercises the script against representative input, with assertions on the output.
  • A runbook entry for the operational procedure, if the script is part of an incident response.

Critical9 items

  1. head -1 script.sh
  2. head -5 script.sh
  3. grep -n "set -[a-z]*x" script.sh
  4. grep -n flock script.sh

Warning7 items

  1. shellcheck script.sh

Info4 items

  1. bash --version