🐚
Active Module Path

Shell Scripting

Master bash scripting from quoting and expansion through awk, error handling and CLI design β€” ending in four production-grade projects.

beginner level

7 lessons
Lesson 1 β€’ ⏱️ 16m
Terminal Navigation, Shell Basics & Executables

Master terminal commands, shell translation pipelines (AST), execution triggers (execve), and octal permission flags mathematically.

βœ“
Lesson 2 β€’ ⏱️ 17m
Variables, Input & the Environment

How bash actually stores values, the difference between a shell variable and an environment variable, and why a child process cannot see what you just set.

βœ“
Lesson 3 β€’ ⏱️ 18m
Quoting, Word Splitting & Expansion

The single largest source of shell bugs, resolved: what the shell does to your text before the command ever runs, and why every unquoted variable is a latent failure.

βœ“
Lesson 4 β€’ ⏱️ 15m
Arguments & Exit Codes

Master parameter arrays ($1, $#), whitespace boundaries, shift operations, and system exit code lookup tables.

βœ“
Lesson 5 β€’ ⏱️ 17m
Conditionals, Tests & Pattern Matching

Why `if` tests an exit status rather than a boolean, the real differences between `[ ]` and `[[ ]]`, and every file test operator worth knowing.

βœ“
Lesson 6 β€’ ⏱️ 16m
Loops & Control Flow

Every loop form bash offers, the arithmetic and C-style variants people forget, and the iteration mistakes that quietly process the wrong things.

βœ“
Lesson 7 β€’ ⏱️ 16m
Arrays & Associative Arrays

Store lists and lookup tables without resorting to space-delimited strings, and learn the expansion rules that make arrays safe where plain variables are not.

βœ“

intermediate level

9 lessons
Lesson 8 β€’ ⏱️ 17m
Functions, Scope & Return Values

Why bash variables are global by default, the two ways to get data out of a function, and the scoping rules that make shell functions behave unlike every other language you know.

βœ“
Lesson 9 β€’ ⏱️ 18m
Pipes, Redirection, Here-Docs & Process Substitution

Wire file descriptors deliberately: why `2>&1` order matters, how here-docs generate config, and why a pipeline loses your variables.

βœ“
Lesson 10 β€’ ⏱️ 16m
The Text Processing Toolkit

grep, cut, sort, uniq, tr and find β€” the filters that compose into a pipeline, and the flags that matter when the data is real.

βœ“
Lesson 11 β€’ ⏱️ 19m
awk & sed in Depth

Two small languages that replace most log-processing scripts: awk's record model and sed's line editor, with the idioms that actually come up in production.

βœ“
Lesson 12 β€’ ⏱️ 16m
Reading Files & Streams Safely

The one correct `while read` idiom, why every variation of it loses data, and how to handle filenames that contain spaces, backslashes and newlines.

βœ“
Lesson 13 β€’ ⏱️ 19m
Error Handling & the Limits of Strict Mode

Why `set -euo pipefail` is necessary, why it is not sufficient, and the specific constructs where it silently stops protecting you.

βœ“
Lesson 14 β€’ ⏱️ 16m
Debugging, Tracing & Making Scripts Observable

Turn `set -x` into a readable timeline, trace only the section you care about, and build logging that survives cron and CI where you cannot watch the terminal.

βœ“
Lesson 15 β€’ ⏱️ 16m
Modular Scripts, Libraries & Project Layout

Split a growing script into sourceable libraries without namespace collisions, resolve paths reliably regardless of where the script is invoked from, and know when to stop using bash.

βœ“
Lesson 16 β€’ ⏱️ 45m
Project 1: Backup & Restore System

Build a production backup tool with rotation, integrity verification, and a restore path you have actually tested β€” the project that proves you can write shell people depend on.

βœ“

advanced level

10 lessons
Lesson 17 β€’ ⏱️ 17m
Building Real CLI Tools with getopts

Parse flags properly, write usage that doubles as documentation, and give your script the interface conventions every other Unix tool follows.

βœ“
Lesson 18 β€’ ⏱️ 18m
Background Jobs, Signals & Parallel Execution

Run work concurrently and collect the results, handle Ctrl+C without leaving orphans, and know why a script that ignores SIGTERM breaks every deploy that uses it.

βœ“
Lesson 19 β€’ ⏱️ 16m
Cron, systemd Timers & Safe Scheduling

Why a script that works in your shell fails at 3am under cron, and the four defences every scheduled job needs before it goes anywhere near production.

βœ“
Lesson 20 β€’ ⏱️ 18m
Remote Operations & Working with APIs

Drive fleets over SSH without your loop eating its own input, move data with rsync safely, and turn curl plus jq into a reliable API client.

βœ“
Lesson 21 β€’ ⏱️ 17m
Log Analysis, Monitoring & Alerting

Turn raw logs into a ranked answer, decide what genuinely deserves a page, and deliver alerts that carry enough context to act on.

βœ“
Lesson 22 β€’ ⏱️ 17m
ShellCheck, Style & POSIX Portability

Let a static analyser find your quoting bugs, adopt a style that survives code review, and know exactly which constructs break when `/bin/sh` is not bash.

βœ“
Lesson 23 β€’ ⏱️ 18m
Testing, Secrets & Knowing When to Leave Bash

Write real tests for shell code with bats, handle credentials without leaking them into logs or process lists, and recognise the point where another language is the professional choice.

βœ“
Lesson 24 β€’ ⏱️ 50m
Project 2: Service Health Monitor & Alerter

Build the monitoring agent you would actually trust on-call: plugin-style checks, flap damping, deduplicated alerts, recovery notices, and a dead-man switch.

βœ“
Lesson 25 β€’ ⏱️ 55m
Project 3: Zero-Downtime Deploy & Rollback

Build a deploy tool with atomic release switching, health-gated cutover, and a rollback that works when everything else has failed β€” the script that earns production access.

βœ“
Lesson 26 β€’ ⏱️ 60m
Project 4 (Capstone): Log Forensics & Incident Report Generator

The capstone: ingest heterogeneous logs, correlate them into a timeline, detect anomalies against a baseline, and emit a postmortem-ready incident report.

βœ“

πŸ—ΊοΈ Beginner β†’ Expert Roadmap

3 stages with prerequisites and a concrete mastery check at each.

🎯 What You'll Learn

  • β€’ Quote every expansion correctly β€” the single largest source of shell bugs.
  • β€’ Write robust command-line scripts to automate configuration, backup, and diagnostic routines.
  • β€’ Use conditional logic, loops and arrays to audit files and process logs line-by-line.
  • β€’ Apply strict mode and know the five contexts where set -e stops protecting you.
  • β€’ Replace multi-stage pipelines with a single awk program.
  • β€’ Build proper CLIs with getopts, subcommands and conventional exit codes.
  • β€’ Schedule unattended work that survives cron, with locking and timeouts.
  • β€’ Pass ShellCheck cleanly and know what breaks under /bin/sh.
  • β€’ Ship four production-grade projects: backup, monitoring, deployment and log forensics.
  • β€’ Judge when a script has outgrown bash β€” and hand it to Python deliberately.