Valid PT0-003 Dumps shared by ExamDiscuss.com for Helping Passing PT0-003 Exam! ExamDiscuss.com now offer the newest PT0-003 exam dumps, the ExamDiscuss.com PT0-003 exam questions have been updated and answers have been corrected get the newest ExamDiscuss.com PT0-003 dumps with Test Engine here:
A penetration tester writes the following script to enumerate a /24 network: 1 #!/bin/bash 2 for i in {1..254} 3 ping -c1 192.168.1.$i 4 done The tester executes the script, but it fails with the following error: -bash: syntax error near unexpected token 'ping' Which of the following should the tester do to fix the error?
Correct Answer: A
The missing do keyword is the reason for the syntax error. Bash for loops must include a do statement before executing commands within the loop. Corrected script: #!/bin/bash for i in {1..254}; do ping -c1 192.168.1.$i done From the CompTIA PenTest+ PT0-003 Official Study Guide (Chapter 4 - Scanning and Enumeration): "In Bash scripting, control structures like for-loops require correct syntax, including the 'do' keyword for loop logic to execute properly." Reference: Chapter 4, CompTIA PenTest+ PT0-003 Official Study Guide