問題文
A shell script runs the same three health checks for every host, and the blocks differ only in the host name. Which change keeps the logic in one place?
選択肢
- Move the repeated checks into a copied code block and take the host name from the script filename on each call.
- Move the repeated checks into a single callable function and take the host name from the inventory listing on each call.
- Move the repeated checks into a single callable function and take the host name from the script filename on each call.
- Move the repeated checks into a copied code block and take the host name from the inventory listing on each call.