Question 720
An operator is asked to correct this issue: A script uses $* without quotes to pass user arguments to a child command. What should the engineer do first?
Explanation
Correct Answer
Unquoted expansion can merge or split intended argument boundaries. This action corrects the relevant condition. Verify that the receiving command sees exactly the original argument list.
Incorrect Answers
That remedy is appropriate when a script executes a second command even after the first command fails. It targets shell command exit statuses require explicit checks to implement fail-fast behavior; here unquoted expansion can merge or split intended argument boundaries, so it does not directly repair the observed fault.
This change addresses a backup script overwrites a result file because it uses > instead of >>. The present problem is different: unquoted expansion can merge or split intended argument boundaries. Applying the alternative would leave the key cause unresolved.
It would correct a separate failure, a shell script starts with #!/bin/sh but uses Bash-only arrays. In this environment, unquoted expansion can merge or split intended argument boundaries; the indicated alternative does not meet the acceptance test.





CompTIA Linux+ (XK0-006) Practice Tests