Course details
Shell / Bash
Learn to write Bash scripts that are safe, readable and reusable. You will grow one small backup script from three typed commands into a tool with arguments, checks, loops and functions, learning why every quote and bracket is there.
Course curriculum
Your First Bash Script3 lessons
What Bash is, why scripting beats retyping, how a script file is laid out, and the three ways to run one. You start backup.sh, the script this whole course grows.
Variables and Data4 lessons
Create and change variables, learn the quoting rules that stop spaces from breaking your script, do whole-number arithmetic, and keep lists in arrays. backup.sh stops hard-coding its paths.
Input and Output4 lessons
Read answers from the user, format output with printf, write multi-line text with here documents and here strings, and capture a command's output with command substitution. backup.sh learns to ask, report and stamp its archives with the date.
Arguments and String Manipulation4 lessons
Read positional arguments, pass every argument on safely with "$@", step through them with shift, and cut, trim and replace text with parameter expansion. backup.sh starts taking its folder from the command line.
Exit Codes and Conditionals4 lessons
Read and set exit codes, branch with if and the [[ ]] test, chain commands with && and ||, and match patterns with case. backup.sh learns to refuse bad input and stop when something fails.
Loops and Functions5 lessons
Walk lists with for, repeat on a condition with while and until, steer loops with break and continue, then organise the script into functions with local variables. backup.sh becomes a small, well-structured tool.
