Shell scripting and automation

Turn your chores into scripts that behave.

⏰ 9 weeks🎯 Standard🧩 Capstone🖥 Any device · our GPUs
Generated from this course

🎯 About this course

You already type commands. This course turns the chores you repeat into scripts that other people can trust: they take arguments, check their input, fail loudly and run on a schedule. Every exercise names who needs the script and why it is done that way, and a simulated machine runs your scripts and checks the result.

By the end you will be able to

  • Write a shell script with a shebang, a header and the right permission, and run it three ways, explaining the difference.
  • Use arguments, defaults and required values to give a script inputs, and quote variables so that awkward values do not break it.
  • Use if, tests and case to choose between branches, and make a script refuse to run when its input is wrong.
  • Write for, while read and until loops that process files and the lines of a CSV, and explain why a pipe loses a loop's variables.
  • Write functions with local variables and shared libraries, use arrays and lookups, and clean and total text with cut, sed, awk and here-documents.
  • Write scripts that handle any file name safely, using quotes, --, NUL-separated lists and temporary files that clean themselves up.
  • Use strict mode and exit statuses so that a failing script stops and says so, and check inputs with clear messages and the right status.
  • Write scripts that clean up with traps, write results atomically and take locks, and debug a failing script with bash -n, set -x and bisection.
Curriculum

Topics covered

Scripts that behave 5 topics

  • Entry check: are you ready to script?
    A forty-five minute check of the command-line skills this course builds on, with a pointer to the Linux from zero topic to revisit for each one.
  • Anatomy of a script
    What a shell script is, the shebang and the execute permission, three ways to run it, a header, the habit of quoting variables, and where scripts live.
  • Variables, arguments and defaults
    Variables and command substitution, positional arguments and $@, defaults and required values with ${1:-x} and ${1:?msg}, shift, trimming text, and arithmetic.
  • Decisions: if, tests and case
    if and elif, tests with [[ ]], numbers and text, guard clauses with errors to standard error, && and ||, and case for many choices.
  • Loops: for, while read and until
    for loops over lists and files, while read for the lines of a CSV with IFS, the subshell trap, until and counters, and break and continue.

Doing more 4 topics

  • Functions and return values
    Defining and calling functions, status versus value, local variables, using a function in if, and a library of shared functions.
  • Arrays and lookups
    Indexed arrays and how to loop over them, reading a file with mapfile, associative arrays for lookups, checking keys, and passing arrays to functions.
  • Text tools inside scripts: cut, sed, awk and here-documents
    Choosing between cut, sed, awk and sort for the four text moves, adding up with awk arrays, masking text with sed, and writing messages with here-documents.
  • Files and names safely
    Why file names are dangerous, quoting and --, loops with wildcards, find with NUL separators, tidying names without overwriting, and temporary files with mktemp and a…

Scripts that fail well 4 topics

  • Exit status and strict mode
    The meaning of exit codes, set -e, set -u and pipefail, what strict mode does not catch, expected failures, and making failure visible.
  • Checking input and reporting errors
    Checks at the top of a script (arguments, shape, allowed values, files, size), usage messages and die functions, regular expressions and case for validation, good error…
  • Traps, locks and clean-up
    Traps on EXIT, ERR and INT, reporting the failing line, atomic writes with a temporary file and mv, locks with mkdir and flock, and the standard shape of a script that…
  • Debugging scripts
    Checking syntax with bash -n, reading the usual error messages, tracing with set -x and PS4, looking at values with declare -p, bisecting to the first bad line, and a…

Automation 4 topics

  • Options with getopts
    Positional arguments or options, reading options with getopts and OPTARG, silent mode for unknown options and missing values, shifting to the operands, defaults and…
  • Logging and reports
    One log format with levels, where output goes (standard error, a log file, tee, exec and the system log), a verbosity switch, a summary from an EXIT trap, reading the…
  • Scheduling properly
    Cron's small environment, testing a line with env -i, crontab lines with a schedule, a lock, a full path and a log, safe changes to the crontab, repeat-safe jobs, and…
  • Projects studio: four automation projects
    Four small projects built with the whole module: a backup rotator, an access-log digest, a health check and a new-member onboarding script, each with a story, a reason…

Infrastructure behind your scripts 4 topics

  • What runs your script: shell, process, environment
    What runs a shell script: the shell process, fork and exec, the interpreter named by the shebang, the environment, file descriptors and the exit status, with a card for…
  • Signals, jobs and process lifetime
    Signals and what a process does with them, the process table and states, background jobs with wait, traps for clean-up, orphans and zombies, and how to read the exit…
  • Scheduling at scale: overlap, missed runs and pile-up
    How scheduled jobs go wrong: runs that overlap, runs that are missed, and runs that pile up, with cron's environment, flock, systemd timers and the clock, and a card for…
  • Running and watching automation: logs, alerts and safe repeats
    How to run automation so you can trust it: logs with levels, heartbeats that catch silence, idempotent steps, retries with backoff, and log rotation, with a card for…

Interview ready 2 topics

  • Interview ready: scripting basics and safety
    The questions people really ask about scripts, quoting, strict mode, functions, file names and exit statuses, with model answers, timed terminal tasks and a mock round.
  • Interview ready: automation, debugging and a mock round
    The questions people really ask about cron, locks, options, logging and debugging, with model answers, timed terminal tasks and a mock round.
Course at a glance

See how this course is built

Where the time goes

Longer spokes mean more hours on that module.

Course roadmap click a step

Try a lesson0 / 3

Sample questions from this course. Your progress is kept only in your browser.

Week by week

Drag the slider, or press play, to walk through the course and see what you will have built by each week.

Week 1 of 9
Wk 1

The chores list

The warm-up studio and scene 1: anatomy of a script.

Wk 2

Inputs and decisions

Scenes 2 and 3: arguments, defaults, tests and case.

Wk 3

Loops

Scene 4: for, while read and until.

Wk 4

Functions, arrays, text, files

Scenes 5 to 8: functions, arrays, text tools and safe file handling.

Wk 5

Failing well

Scenes 9 to 12: strict mode, input checks, traps, locks and debugging.

Wk 6

Automation

Scenes 13 to 16: options, logging, scheduling and the projects studio.

Wk 7

Under the hood

Scenes 17 to 20: what runs a script, signals, scheduling at scale and watching automation.

Wk 8

Interview ready

Scenes 21 and 22: model answers, timed scripting tasks and mock rounds.

Wk 9

Capstone

Present the capstone: the Harbour Street automation pack.

What you'll build

The report scripts

A tested room-report script that takes a room, checks its data, and loops over every room.

Scheduling and watching sheet

Five cards for the parts that run a script, a crontab line with a lock, full paths and a log, a heartbeat check, and one failure drill worked through.

Why take this course

  • Automate the chores you repeat
  • Run real scripts in a simulated machine
  • Learn the safety habits that matter

You will build

  • A report script that takes a room
  • A script that loops over data
  • A scheduled, logged job

What you can do afterwards

  • Write scripts others can trust
  • Explain what each line does and why
  • Answer scripting interview questions
How to take it

💳 Delivery & fees

One course, four ways to attend. Fees are per course, in rupees excluding 18% GST (the GST-inclusive amount is shown too).Fees are per course, in Canadian dollars, before applicable GST/HST.Fees are per course, in US dollars, before any applicable local taxes. Bulk and institutional volume pricing is available.

Self-paced

₹1,33,000

+ 18% GST · ₹1,56,940 all-in

Programme ₹1,15,700 + infrastructure & GPU labs ₹17,300

≈ ₹14,778 per week ex-GST over 9 weeks

CA$14,500

per course, before applicable GST/HST

Includes our GPU lab infrastructure: no cloud credits to buy

≈ CA$1,611 per week over 9 weeks

US$10,400

per course, before any applicable local taxes

Includes our GPU lab infrastructure: no cloud credits to buy

≈ US$1,156 per week over 9 weeks

  • Full recorded library
  • Browser GPU lab
  • All project briefs
  • Mentor review add-on
Most popular

Live online

₹1,59,500

+ 18% GST · ₹1,88,210 all-in

Programme ₹1,38,700 + infrastructure & GPU labs ₹20,800

≈ ₹17,722 per week ex-GST over 9 weeks

CA$17,400

per course, before applicable GST/HST

Includes our GPU lab infrastructure: no cloud credits to buy

≈ CA$1,933 per week over 9 weeks

US$12,500

per course, before any applicable local taxes

Includes our GPU lab infrastructure: no cloud credits to buy

≈ US$1,389 per week over 9 weeks

  • Everything in self-paced
  • Scheduled live classes
  • 1:8 mentor code review
  • Cohort + capstone review

Hybrid — weekend

₹1,73,000

+ 18% GST · ₹2,04,140 all-in

Programme ₹1,50,400 + infrastructure & GPU labs ₹22,600

≈ ₹19,222 per week ex-GST over 9 weeks

CA$18,850

per course, before applicable GST/HST

Includes our GPU lab infrastructure: no cloud credits to buy

≈ CA$2,094 per week over 9 weeks

US$13,500

per course, before any applicable local taxes

Includes our GPU lab infrastructure: no cloud credits to buy

≈ US$1,500 per week over 9 weeks

  • Recorded weekday lessons
  • Live weekend sessions
  • Full mentor review
  • Cohort + capstone

Live in-person

₹1,93,000

+ 18% GST · ₹2,27,740 all-in

Programme ₹1,67,800 + infrastructure & GPU labs ₹25,200

≈ ₹21,444 per week ex-GST over 9 weeks

CA$21,050

per course, before applicable GST/HST

Includes our GPU lab infrastructure: no cloud credits to buy

≈ CA$2,339 per week over 9 weeks

US$15,100

per course, before any applicable local taxes

Includes our GPU lab infrastructure: no cloud credits to buy

≈ US$1,678 per week over 9 weeks

  • Everything in live online
  • Classroom instruction
  • On-site mentor time
  • In-person study group

Bulk and institutional pricing. Volume discounts are available for institutions, campuses, companies and groups enrolling several learners. Ask for a group quote →

Your fee includes our GPU lab infrastructure — no cloud credits to buy. See how we compare, with sources →

Ready when you are

Apply for this course

Tell us the format you prefer and we'll confirm the next cohort date and your fee on a short call.

Apply for this course