Valid PT0-003 Dumps shared by EduDump.com for Helping Passing PT0-003 Exam! EduDump.com now offer the newest PT0-003 exam dumps, the EduDump.com PT0-003 exam questions have been updated and answers have been corrected get the newest EduDump.com PT0-003 dumps with Test Engine here:
A penetration tester writes the following script to enumerate a 1724 network: 1 #!/bin/bash 2 for i in {1..254}; do 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: B
The syntax (1..254) is incorrect in Bash, as it uses brace expansion or seq for looping. The correct syntax should be: for i in $(seq 1 254) Also, the missing do is an issue, but the syntax error mentioned points specifically to the loop structure. Fixing the sequence format resolves it. Corrected script: #!/bin/bash for i in $(seq 1 254); do ping -c1 192.168.1.$i done From the CompTIA PenTest+ PT0-003 Official Study Guide (Chapter 4 - Scanning & Enumeration): "Bash scripting is commonly used for automation in enumeration. The ' seq ' command generates a sequence of numbers for iteration in loops." Reference: CompTIA PenTest+ PT0-003 Official Study Guide, Chapter 4 ======