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
.shis a filename convention, not executable permission..means the current directory, so./maker-report.shnames the file here.- In
chmod u+x,uis the user who owns the file andxis execute permission. #!/bin/bashtells Linux to use Bash when the file is run directly.- Shell assignment has no spaces around
=. - Quotes are needed both when passing a multi-word argument and when expanding it.
- Triple backticks open and close the report’s plain-text code block.
bash -xreveals commands as Bash runs them and keeps its trace on stderr.
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?
- Why can
bash maker-report.shrun a non-executable text file? - What does
./mean? - What does
chmod u+xchange? - What does the
#!/bin/bashfirst line tell Linux? - Why is
report_title = "$1"wrong? - Why do both the caller and the script use quotes?
- How does one
>capture output from every command inside{ ... }?
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.

Linux Foundations