Learn Bash scripting: variables, read, arithmetic, tests, loops, functions, arrays and text processing with builtins.
8 lessons, 16 exercises. Runs Bash 5.2.
Not started
Hello, output
Print text with echo and printf, write comments, and see how Bash runs a script one command at a time.
Variables and read
Store text in variables, expand them safely with quotes, and read input lines with read.
Arithmetic
Calculate with whole numbers using $(( )) and (( )), and learn the limits of Bash maths.
Conditionals and tests
Make decisions with if, [[ ]] tests, (( )) number comparisons and case, all driven by exit statuses.
Loops
Repeat commands with for and while loops, read input line by line, and control loops with break and continue.
Functions
Group commands into functions, pass arguments as $1 and $2, return results through output and exit status, and keep variables local.
Arrays
Keep lists in indexed arrays, look values up by key in associative arrays, and fill arrays from input with read -a and mapfile.
Text processing and a small project
Measure, slice, change case and replace text with parameter expansion, split lines with IFS, and build a small log report.
Your progress is saved in this browser. Sign in to keep it on every device.