Kolam Ayer MakersLinux Foundations

S5 Recap: Make The Shell Work For You

Session: S5

What You Built

~/scripts/maker-report.sh accepts one title, collects live system facts, and writes ~/src/pages/maker-report.md. build-website turns that Markdown into maker-report.html.

Four Models

bash maker-report.sh -> start Bash explicitly; execute permission is not needed
./maker-report.sh    -> run the file here; requires execute permission and a shebang
"My Maker Report" -> $1 -> report_title="$1" -> "$report_title" -> one value
{
  many commands
} > file

many stdout streams -> one generated file
maker-report.sh -> maker-report.md -> build-website -> maker-report.html

Details Worth Remembering

Repeat The Safe Workflow

cd ~/scripts
bash -n maker-report.sh
./maker-report.sh "Fresh Report"
cat ~/src/pages/maker-report.md
build-website

Optional Reinforcement

Three sequential extensions follow the live objectives: add uptime, run the script from another directory, and preserve it in Git.

The self-study guide also contains an unscored shell-options appendix. It demonstrates set -u with an unset $1, then set -e with one standalone failed command. These options reveal failures; they do not replace input checks or explicit error handling.

Can You Explain This?

Full Autonomy

Use S5 Self-Study Guide: Make The Shell Work For You for every exercise, the complete script, reset steps, and symptom-based recovery.