Question 40
Original unofficial RHEL 10 RHCSA skill-check scenario: A maintenance script reads a password-containing file using an unquoted redirection target with spaces and fails. Which ongoing practice best prevents a recurrence?
Explanation
Correct Answer
In this RHEL 10 system administration case: A maintenance script reads a password-containing file using an unquoted redirection target with spaces and fails. Underlying reason: Unquoted path expansion can change the word count presented to a command. The most direct, approved resolution is: Quote the intended pathname and secure the file's ownership and mode before redirecting input. Confirm it by checking: The program reads the exact file without expansion into multiple arguments. Sustain the fix by: Test quoting and protect sensitive files in scripting reviews. This is the INTENDED response for the best ongoing operational safeguard. It is a knowledge-check explanation, not a verified hands-on Red Hat exam answer;
Incorrect Answers
Include stderr handling in shell monitoring templates. That is not sufficient for the reported RHEL task, because unquoted path expansion can change the word count presented to a command.
Verify representative hidden files in backup tests. That is not sufficient for the reported RHEL task, because unquoted path expansion can change the word count presented to a command.
Set appropriate file modes during report generation. That is not sufficient for the reported RHEL task, because unquoted path expansion can change the word count presented to a command.