CodeRigor

FREE COURSE / REAL PRACTICE

Bash & shell scripting

Make arguments, quoting, streams, pipelines, files and processes work together in dependable shell programs.

Free lessons & exercises9 authored lessons4 units

What you’ll work toward

Build command-line tools that preserve filenames and arguments, report errors and clean up resources deliberately.

Read an explanation, inspect the diagrams and work through the available checks, debugging exercises and builds. Feedback and prerequisite links guide the next step.

Before you start

The entry lesson has no earlier CodeRigor skill prerequisite. Start there and follow the sequence.

Individual lessons can add prerequisites. The course map shows your actual readiness.

A look inside the first lesson

Arguments, quoting & expansion

Bash
values=('two words' '' '*')
printf 'count=%s\n' "${#values[@]}"
for value in "${values[@]}"; do printf '<%s>\n' "$value"; done

Your course outline

Follow the lessons in curriculum order. Open a unit to preview the ideas you’ll work with.

UNIT 013 lessons Bash: quoting, conditions & arrays
  1. LESSON 01.01

    Arguments, quoting & expansion

    Preserve argument boundaries, empty values and literal pattern characters when expanding shell data.

    Open lesson
  2. LESSON 01.02

    Exit status, tests & conditions

    Use status as control flow, distinguish string and arithmetic tests, and validate numeric input before arithmetic.

    Open lesson
  3. LESSON 01.03

    Loops, indexed arrays & exact matching

    Build arrays without splitting elements, preserve encounter order and compare user strings literally.

    Open lesson
UNIT 022 lessons Bash: functions & pipelines
  1. LESSON 02.01

    Functions, scope & argument forwarding

    Use function-local variables and positional arguments without changing the caller’s state.

    Open lesson
  2. LESSON 02.02

    Pipelines, redirection & failure propagation

    Connect streams, keep diagnostics separate and detect an upstream failure even when the last command succeeds.

    Open lesson
UNIT 032 lessons Bash: text reports & files
  1. LESSON 03.01

    Text tools, fields & deterministic reports

    Filter structured text, aggregate repeated keys and sort explicitly rather than depending on map iteration order.

    Open lesson
  2. LESSON 03.02

    Files, pathnames & safe tool arguments

    Handle filenames as data, use redirection and option terminators, and avoid parsing ls output.

    Open lesson
UNIT 042 lessons Bash: processes & command-line tools
  1. LESSON 04.01

    Background work, wait & cleanup traps

    Wait for the child you launched, preserve its status and remove temporary work on the parent’s exit path.

    Open lesson
  2. LESSON 04.02

    Robust command-line scripts & validation

    Separate option parsing from data, preserve empty values and return clear diagnostics and exit statuses.

    Open lesson