Build read-only reports and reliable local automation using functions, descriptors, status handling and reproducible tests. Use synthetic data rather than actual administration targets. Complete the linked practice, projects and offline cumulative assessment.
Learning outcomes
Earn a cryptographically verifiable Certificate of Completion to showcase on LinkedIn and your resume upon finishing all module lessons and assessments.
Separate a report workflow into helpers with explicit inputs, local variables and return statuses. Practice: In a disposable directory write a trusted helper file defining a severity validator and a summary printer. Source it by explicit path; demonstrate invalid input and a local variable shadowing an outer value.
Route report data and diagnostics independently; explain descriptor duplication order and lifetime. Practice: Generate two fixed messages in a private fixture; capture stdout and stderr separately, then compare the two redirection orders. Use a quoted heredoc to preserve literal dollar signs; close an explicitly opened descriptor.
Choose the correct execution context and capture individual pipeline failures. Practice: Compare command resolution for a fixed function and builtin; run a failing three-stage pipeline, record PIPESTATUS immediately, then contrast variable assignment in a group and subshell.
Build a validated read-only report from synthetic records and preserve filename boundaries. Practice: Complete Log Severity Report. In a separate private fixture create names with spaces and compare find -print0 with a quoted read loop using a NUL delimiter. Compare an empty report with an invalid record.
Specify input, output and error contracts before invoking local automation. Practice: Complete CLI Option Parser; design an extra valid name containing spaces and a leading hyphen as an option value, plus a rejected duplicate flag. Write expected streams and status first.
Preserve failures through cleanup and avoid relying on errexit as a universal error handler. Practice: Complete Failure-aware Wrapper; trace success and task failure, then show a separate pipefail example and an optional variable default under nounset.
Use reproducible fixtures to distinguish command failures, expected negative outcomes and logic errors. Practice: Complete Regression Test Suite; compare a missing final newline with the expected exact bytes. Run bash -n and record one trace of a synthetic script (no secrets).