CompTIA
XK0-004 · 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?
Exhibit
Options
- Ashould be changed to in the 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
(29 responses)- A14% (4)
- B3% (1)
- C7% (2)
- D76% (22)
Explanation
if the script finds company A, the result should be equal to 0.
Topics
#bash scripting#conditional logic#comparison operators#script debugging
Community Discussion
No community discussion yet for this question.
