Skip to main content
DevOpsLabTH.dev

Bash

Move from typing commands to writing scripts that survive Monday morning. Loops, exit codes, traps, defensive scripting.

Hands-on labsbeginner16 labs
Start course
Recommended first

You can still start this course now. Earlier courses give you the mental model the labs here assume.

By the end you'll be able to
  • Write scripts that fail loudly instead of silently
  • Handle arguments, exit codes, and traps like a grown-up
  • Loop over real data without choking on whitespace
  • Debug a broken script in production without rewriting it

Modules

Work through the labs in order. Each module builds one operating habit.

  1. 01
    Make a script runnable
    A script is a text file with a shebang on line one and the execute bit set. Three small steps to turn typed commands into a program.
    15 min
    Start
  2. 02
    Read what every command returns
    Every command returns a number when it finishes. Zero means success, anything else means failure. This number is how scripts detect errors.
    15 min
    Start