📜 Shell Scripting
Write Bash that survives spaces, empty variables, and CI — quoting, control flow, functions, pipes, text processing, and the discipline that keeps scripts from silently corrupting your machine. Targets Bash 5.x and POSIX shells; great prep for the shell portions of the LFCS.
0/8
1Free2🔒3🔒★🔒 Standard4🔒5🔒6🔒★🔒 Standard🎓🔒 Professional
Variables & Quoting
Master single vs double quotes, kill word-splitting bugs, and wield parameter expansion — defaults (${x:-}), required-checks (${x:?}), substrings, pattern stripping, and arrays that keep their elements intact.
Control Flow
Wire up branching and loops that hold: [[ ]] tests vs [ ], (( )) arithmetic, case with fall-through, the exit-code model behind if, and the &&/|| short-circuit trap — plus the glob-that-matches-nothing gotcha.
Functions & Arguments
Write functions that behave: $1..$@, the critical "$@" vs "$*" difference, shift for argument parsing, local scope to avoid clobbering globals, and returning data via stdout instead of the exit code.
Chapter review
Chapter review — write a robust script
Lab: Build a small, correct shell script from scratch · 10-question check
Pipes & Redirection
Take command of stdin, stdout, and stderr: redirect and append, merge streams with order-sensitive 2>&1, feed here-docs and here-strings, use process substitution, and unmask hidden failures with pipefail.
Text Processing
Reshape real log and data files with the classic toolkit: grep for filtering, sed for substitution, awk for field math and aggregation, and cut/sort/uniq/tr for columns, ranking, and frequency counts.
Robust Scripting
Ship scripts that fail loud, not silent: set -euo pipefail, EXIT/ERR traps that always clean up, safe mktemp temp files, idempotent operations, honest exit codes, and shellcheck to catch bugs early.
Chapter review
Chapter review — a hardened log pipeline
Lab: Build and harden a log-processing pipeline · 10-question check
Final exam
Shell Scripting — comprehensive capstone
Hands-on capstone + course-wide exam · scored to a role level