Card, PayPal or bank transfer · Morocco and worldwideتعلَّم · مارِس · أتقِن

Catalogue / Infrastructure & systems

Professional Bash scripting: automating Linux administration

Move from the small script that "works on my machine" to a reliable operations tool — expansions, arrays, error handling, options, logs, locks and scheduling — all the way to a production-grade backup script.

  • Intermediate to advanced
  • 12 lessons
  • 10 h 20 min

A MasterLinux course · Original text

What you will learn

  • Manipulate strings without external commands using parameter expansions
  • Master quoting, word splitting and globs so file names never break again
  • Write precise conditions with [[ ]], regular expressions and (( )) arithmetic
  • Build robust loops (NUL separators, subshells, last line, retries)
  • Organise code into reusable functions and libraries with controlled scope
  • Use indexed and associative arrays to count, group and build safe commands
  • Integrate grep, sed and awk into scripts, generate files with here-docs and write them atomically
  • Handle errors like in production with set -euo pipefail, trap and documented exit codes
  • Offer real options (getopts, long options), log, lock with flock and schedule with cron or systemd
  • Apply ShellCheck rules and deliver a complete, tested backup script

Course content

12 lessons · 10 h 20 min

Requirements

  • The “Fundamentals” course (or able to write a small script with if, for, while and functions)
  • Comfortable with redirections, pipes and basic grep, sed and awk
  • A Linux machine (VM, WSL or test server) to reproduce the examples

Who is this course for?

  • System administrators and operations technicians who automate their daily tasks
  • Students preparing for an infrastructure, DevOps or level 2 support role
  • Developers who write deployment, backup or CI scripts