Question 490
A Linux administrator evaluates: A developer needs a controlled while-read loop that preserves the complete path stored on each input line. Select TWO complementary answers: the most suitable corrective action AND the evidence proving it worked.
Explanation
Correct Answers
For the specific observation (A developer needs a controlled while-read loop that preserves the complete path stored on each input line), the acceptance evidence is: A test directory with spaces and unusual characters processes the intended set of files exactly once. This verifies the action (Iterate over files using appropriately quoted arrays or null-delimited find output rather than splitting arbitrary file paths on whitespace.) rather than merely proving that an unrelated Linux tool works. It also addresses the known risk: A naïve for loop over command-substitution output can mis-handle filenames with spaces or newlines.
The observed Linux condition is: A developer needs a controlled while-read loop that preserves the complete path stored on each input line. The recommended direct administrative response is: Iterate over files using appropriately quoted arrays or null-delimited find output rather than splitting arbitrary file paths on whitespace. The relevant failure or security risk is: A naïve for loop over command-substitution output can mis-handle filenames with spaces or newlines. Validate success with: A test directory with spaces and unusual characters processes the intended set of files exactly once.
Incorrect Answers
Idempotent configuration with Ansible (4.1) addresses another technical failure: Ad hoc scripts that repeatedly append configuration can create duplicate entries and uncontrolled drift across servers. The case states: the most suitable corrective action AND the evidence proving it worked. The most direct paired action and test is: A test directory with spaces and unusual characters processes the intended set of files exactly once.
AI-generated administration code review and execution safety (4.5) would demonstrate or implement: The proposed automation passes source review and bounded tests without touching unauthorized paths or credentials. The required paired action and test concerns Safe loops and file names in Bash; a passing result for this alternative could leave that requirement unresolved.
Python JSON data extraction and structured error handling (4.3) would demonstrate or implement: Treating JSON as fixed-position plain text or assuming every key exists can produce wrong reports or uncaught exceptions. The paired-answer requirement concerns Safe loops and file names in Bash; this alternative does not provide the matching intervention and separate acceptance evidence.