CompTIA
XK0-005 · Question #133
An analyst is trying to determine which public IP addresses are managed by Company A, but the script is not working correctly. Which of the following explains what is wrong with the script?
The correct answer is D. The -ne flag should be changed to -eq in the if statement. if the script finds company A, the result should be equal to 0.
Scripting, Containers, and Automation
Question
An analyst is trying to determine which public IP addresses are managed by Company A, but the script is not working correctly. Which of the following explains what is wrong with the script?
Options
- A$(cat ip-list.txt) should be changed to
cat ip-list.txtin the for statement. - BThe for should be changed to while in the loop.
- CThe > should be changed to 2> in the do statement.
- DThe -ne flag should be changed to -eq in the if statement.
How the community answered
(55 responses)- A4% (2)
- B15% (8)
- C9% (5)
- D73% (40)
Explanation
if the script finds company A, the result should be equal to 0.
Topics
#Shell Scripting#Conditional Logic#Exit Codes#Debugging
Community Discussion
No community discussion yet for this question.