Question 370
Original unofficial RHEL 10 RHCSA skill-check scenario: An administrator builds a filename from `date` in a script, but a newline and unquoted variable affect the result. Which observation best confirms the intended outcome?
Explanation
Correct Answer
In this RHEL 10 system administration case: An administrator builds a filename from `date` in a script, but a newline and unquoted variable affect the result. Underlying reason: Command substitution produces text that is still subject to later shell expansion. The most direct, approved resolution is: Capture the formatted output into a variable and quote the expansion in path operations. Confirm it by checking: One correctly named file appears with the intended date suffix. Sustain the fix by: Test generated paths before using redirects. This is the INTENDED response for the strongest objective verification result. It is a knowledge-check explanation, not a verified hands-on Red Hat exam answer;
Incorrect Answers
Installed and absent packages take different branches correctly. That is not sufficient for the reported RHEL task, because command substitution produces text that is still subject to later shell expansion.
The reported count equals the number of processed records. That is not sufficient for the reported RHEL task, because command substitution produces text that is still subject to later shell expansion.
The single intended file is created under the full path. That is not sufficient for the reported RHEL task, because command substitution produces text that is still subject to later shell expansion.