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?
A.
$(cat ip-list.txt) should be changed to `cat ip-list.txt` in the for statement.
B.
The for should be changed to while in the loop.
C.
The > should be changed to 2> in the do statement.
D.
The -ne flag should be changed to -eq in the if statement.
The answer can’t be a because the single quotes mean in the command inside won’t be interpreted. b can’t be because it doesn’t make sense , and c also doesn’t make sense. However if you change the -ne to -eq it will make grep act quietly in the back ground which is probably the issue. So the answer is D. Plus no other command except grep has a q flag, and since $? Refers to the last run command it makes sense and the -n option numbers lines in a file which shouldn’t be there.
https://linuxcommand.org/lc3_man_pages/grep1.html
This section is not available anymore. Please use the main Exam Page.XK0-004 Exam Questions
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
ssc1982
Highly Voted 4Â years, 4Â months agoFilipIT
4Â years, 3Â months agoo0o0
3Â years, 11Â months agoluken7777
Most Recent 1Â year, 9Â months agoDiaaEmara
2Â years, 4Â months agoexamtopics_htc
2Â years, 6Â months agomiky_Cissp
4Â years, 1Â month agofrancocaorlini
4Â years, 3Â months agofrancocaorlini
4Â years, 3Â months ago