Question 160
Which risk is most relevant to this scenario: A login script fails on some systems because an environment variable name differs by operating system?
Explanation
Correct Answer
The case-specific hazard is Unportable shell assumptions can break initialization. It matters because Script environments and shells do not expose identical variables; apply the control, Validate environment names and platform compatibility before execution.
Incorrect Answers
The related but distinct situation is “A script loops through mounted volumes but does not exclude system or recovery partitions before formatting”. The case-specific hazard is Incorrect targets can erase operating systems. For the stated problem, “Unportable shell assumptions can break initialization” addresses the central condition.
This option serves the scenario “A PowerShell conditional uses string comparisons for numeric capacity values and sorts 100 below 20”. The exposed failure mode is Wrong data types can suppress capacity warnings. The present scenario is distinguished by “Unportable shell assumptions can break initialization”.
This alternative addresses the separate case “A Bash service restart loop ignores each command exit code and reports success for failed hosts”. The exposed failure mode is False success messages can mask widespread downtime. The deciding requirement here is “Unportable shell assumptions can break initialization”.