Description
💻 System Commands BPT 2 Solutions (Week 1&2 Concepts)
Version: v1_t12025 —
Complete executable shell script solutions for file parsing, conditional logic, and logging using sed, grep, and shell flow control.
This downloadable PDF bundle provides complete, concise solutions (shell commands/scripts) for the System Commands BPT 2 problems. The assignment tests the ability to use advanced text processing utilities and implement fundamental shell logic.
Core Programming Tasks (Problem 1 – 4)
The solutions provide single-line or short shell scripts required to perform specific text and system checks:
- Problem 1 (HTML/Text Parsing): Provide the
sedcommand that uses regular expressions to efficiently extract two pieces of information (country name and capital) from an HTML-like string and print them on separate lines. This requires complex capture groups and back-references. - Problem 2 (Conditional File Check): Write a script snippet using conditional checks (
-d) for directory existence and logical operators (||,&&) to create a file nameddefault_configif either the directoryglobal_configorlocal_configexists. - Problem 3 (Logging and
grep): Write a shell block (ifstatement) that usesgrep -qfor silent searching of a specific error string ("database_error") inapp.log. If the error is found, the script must append a timestamped log message (usingdate) to anerror_report.logfile. - Problem 4 (Regular Expression Filtering): Provide the
grepcommand using the extended regular expression flag (-E) to filter lines that end with a comma followed by one or more digits.
File Format:
- ☑ Shell Commands: Solutions provided as executable single-line commands or short scripts.











Reviews
There are no reviews yet.