This intermediate course turns familiar shell commands into reusable Bash programs. Through six guided labs, you will create executable scripts, accept interactive and argument-based input, branch on system conditions, repeat work with loops, react to command status, and leave timestamped execution history.
The final challenge combines those foundations into an onboard.sh tool that validates one username, avoids duplicate accounts, provisions a Bash user and owned work directory, and records successful creation in an audit log.
What You Will Learn
- Write a Bash script with a shebang, make it executable, and run it with
./ - Store values in variables and accept input with
reador positional argument$1 - Test file existence and numeric user identity with
ifandelse - Iterate over numeric ranges and filename wildcards with
forloops - Repeat while a numeric condition remains true with a
whileloop - Inspect
$?immediately after a command and branch when an operation fails - Append absolute-path log entries and timestamps without overwriting prior history
- Build an argument-validated account-provisioning script with ownership and audit logging
Who This Course Is For
This course is for Linux users who already understand terminal commands, files, permissions, variables, and redirection and now want to combine them into small administrative Bash scripts.
Prerequisites: Comfortable terminal navigation, file operations, Nano or another editor, shell variables, wildcards, command substitution, redirection, permissions, and sudo.
Learning environment: A provided Ubuntu-based LabEx terminal with Bash, editable project scripts, prepared test files, and isolated administrative access for creating challenge-specific local accounts.
Frequently Asked Questions
How is the course structured?
Six labs provide guided scripting practice. The seventh item is a less-guided challenge where you incrementally build and test one executable onboard.sh program.
Does the scheduling lab configure Cron or another scheduler?
No. It prepares a script for unattended use by appending messages and date output to an absolute-path log, then simulates repeated runs manually. Cron configuration is covered elsewhere.
What system changes does the final script make?
In the isolated lab, it uses sudo useradd -m -s /bin/bash to create a real local test account, creates /home/<username>/work, assigns ownership to that user, and appends to ~/project/onboard.log.
How advanced is the error handling?
The course introduces exit status through $?, nonzero exit, argument-count checks, and conditional handling of a failed command or existing user. It does not cover traps, set -euo pipefail, cleanup handlers, or transactional rollback.





