Cron and timers lesson solved a mystery
Our cron job failed silently because of PATH. Fixed within minutes after this lesson.
Browse
Write Bash scripts that quote correctly, fail safely, parse arguments, clean up after themselves and pass ShellCheck, with tests and scheduling
Created by Hana Novak
Most Bash scripts start as a few commands pasted into a file. They work until the day a file name contains a space, a command fails halfway, or the script runs from cron with a different environment. This course teaches you to write scripts that survive those days.
Every concept is shown with a small script you run and then break on purpose. We collect the good habits into a template you can start every new script from. In the last section we write three complete tools you can adapt: a backup script with retention, a log cleanup job and a deployment helper.
We target Bash 5 on Linux. macOS ships an old Bash 3.2 by default and uses zsh as the login shell, so I show how to install a current Bash with Homebrew if you practise on a Mac.
We also discuss honestly when a script has outgrown Bash and should be rewritten in Python or Go.
Linux automation engineer teaching Bash scripting and Ansible for people who manage real servers
I look after fleets of Linux servers and I automate anything I have to do twice. Bash covers the small jobs and Ansible covers everything that needs to be repeatable across many machines.
My courses are practical and a little strict. You will learn to write scripts that fail safely, quote variables properly and log what they did, and playbooks that can run a second time without breaking anything.
I build every lab on virtual machines you can create for free, and I explain each command line flag the first time it appears. If you have ever copied a script from the internet and hoped it worked, my courses are for you.
Our cron job failed silently because of PATH. Fixed within minutes after this lesson.
I had relied on set -e inside functions called from if. The lesson showed exactly why it did not work.
Running ShellCheck on our old scripts found dozens of quoting bugs. The quoting lesson explained every one.
I start every new script from the template built in the course. Fewer bugs and much clearer code.
The backup project with retention and locking is now running on our servers. Bats setup took a little effort.
Short lessons with examples you can break. I liked the honest advice about when to switch to Python.
Solid content, but you should be comfortable with the shell before starting.