Notice: Due to an ongoing migration of our storage and publishing system, material requested since last month will not be uploaded for the time being, and new requests are paused. All existing notes remain available.

Unit 4 subjective questions Advanced Bash Scripting & Automation

CSC104 — It Fundamentals 20 questions with model answers. Write yours first, then compare.

Read the notes Practice MCQs
  1. Question 1 of 20

    Explain the concept of multi-function scripting in Bash. Describe how functions improve the organization, reusability, and maintenance of automation scripts.

  2. Question 2 of 20

    Design and explain the structure of a robust multi-function Bash script that validates input, logs activity, handles errors, and performs a main task.

  3. Question 3 of 20

    Describe how to create an interactive Bash menu with colors. Explain the purpose of ANSI escape sequences and discuss how user choices should be validated.

  4. Question 4 of 20

    Compare the use of a case statement and nested if statements in an interactive Bash menu. Which approach is generally more suitable, and why?

  5. Question 5 of 20

    Explain remote script execution in Bash using SSH. Discuss authentication, quoting, environment variables, file transfer, and security precautions.

  6. Question 6 of 20

    Explain how JSON data can be processed with jq in Bash. Include examples of extracting fields, filtering arrays, and producing formatted output.

  7. Question 7 of 20

    Describe how a Bash script can safely consume JSON returned by a web API. Explain the roles of curl, HTTP status checking, jq, and error handling.

  8. Question 8 of 20

    Explain the main steps required to integrate the Cloudflare API into a Bash automation script for managing DNS records.

  9. Question 9 of 20

    Differentiate between an API token and a global API key when authenticating to Cloudflare. Why is the principle of least privilege important?

  10. Question 10 of 20

    Design an access log summarizer using Bash tools. Explain how the script could calculate request counts, status-code frequencies, top client IP addresses, and error rates.

  11. Question 11 of 20

    Explain how pipelines can be used to build a compact access log analysis command. Discuss the purpose of awk, sort, uniq, head, and grep in the pipeline.

  12. Question 12 of 20

    Describe how to send email from a Bash script using SSMTP or an equivalent lightweight SMTP client. Include configuration, authentication, message construction, and security concerns.

  13. Question 13 of 20

    Compare pipes and redirection in Bash. Explain standard input, standard output, standard error, and the operators commonly used with each mechanism.

  14. Question 14 of 20

    Explain the design and security requirements of a Bash password generator. Discuss randomness, password length, character selection, and handling of generated passwords.

  15. Question 15 of 20

    Derive a secure workflow for generating a password and emailing it to an administrator from a Bash script. Identify the risks and controls required at each stage.

  16. Question 16 of 20

    Explain the purpose of exit statuses in Bash automation. Describe how they should be used when chaining commands, pipelines, API calls, and remote execution.

  17. Question 17 of 20

    Describe the architecture of an automated WordPress installation on a LAMP stack. Identify the role of Linux, Apache, MySQL or MariaDB, PHP, and WordPress.

  18. Question 18 of 20

    Develop a step-by-step plan for automating WordPress setup on a LAMP server. Include idempotency checks so that the script can be safely rerun.

  19. Question 19 of 20

    Explain how a Bash automation script should manage secrets when configuring Cloudflare, SMTP, and WordPress database access.

  20. Question 20 of 20

    Explain the role of quoting and command substitution in advanced Bash scripts. Illustrate how incorrect quoting can affect remote commands, JSON data, filenames, and user input.

That's unit 4

Long answers stick best when they're tested again soon. Run the MCQs on this unit, then come back to the questions you found hardest.