Question 360
Original unofficial RHEL 10 RHCSA skill-check scenario: A script should forward all received filenames but uses `$*` unquoted and merges or splits arguments incorrectly. Which ongoing practice best prevents a recurrence?
Explanation
Correct Answer
In this RHEL 10 system administration case: A script should forward all received filenames but uses `$*` unquoted and merges or splits arguments incorrectly. Underlying reason: Quoted `$@` preserves positional-argument boundaries. The most direct, approved resolution is: Forward the argument vector with quoted `"$@"` to preserve each original argument. Confirm it by checking: The downstream command receives exactly the same number of distinct filenames. Sustain the fix by: Test multiple arguments including spaces and special characters. 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
Document required script arguments with examples. That is not sufficient for the reported RHEL task, because quoted `$@` preserves positional-argument boundaries.
Require failure injection tests for administrative scripts. That is not sufficient for the reported RHEL task, because quoted `$@` preserves positional-argument boundaries.
Include whitespace filenames in script tests. That is not sufficient for the reported RHEL task, because quoted `$@` preserves positional-argument boundaries.