Stage 7 of 8 · 8 lessons · ~3 weeks
Shell scripts and automation
Turn repeated commands into small, safe Bash scripts, check them with ShellCheck, schedule them with cron and keep your own configuration in a dotfiles repository.
Start: Anatomy of a scriptLessons· one lesson for each topic, in this order
Do this
- Write a script with a shebang, `set -euo pipefail`, argument checks and a usage message.
- Make it executable and put it in a folder on your PATH.
- Run ShellCheck and fix every warning, reading the explanation for each.
- Add a loop over files and a function with `local` variables.
- Schedule it with cron using full paths and a log file, and confirm it ran.
- Create a dotfiles repository with your shell and Git config and an install script.
- Run the install script twice to check it is safe to repeat.
Start with· follow one of these
- GuideFreeGreg's Wiki: BashGuide
Greg's Wiki (Wooledge) · Beginner
A careful, accurate Bash guide that teaches the habits that avoid most scripting bugs
- CourseFreeThe Missing Semester of Your CS Education
MIT · Beginner
The shell tools and scripting lecture, with exercises that build useful small scripts
Practise
Keep handy
Also worth your time
- roadmap.sh: Shell / BashGo deeper
The scripting side of the shell map: arrays, traps, parameter expansion and more
Before moving on: A public dotfiles repository with an idempotent `install.sh` that passes ShellCheck with no warnings, plus one useful script of your own (a backup, a cleanup or a report) running from cron and writing to a log.

Automate something you actually do every week, however small. A 20-line script that saves you five minutes every day teaches more than any tutorial. Run ShellCheck on everything, and switch to Python the moment Bash starts to feel like a puzzle.