CompTIA
PT0-003 · Question #17
A penetration tester writes the following script to enumerate a /24 network: The tester executes the script, but it fails with the following error: -bash: syntax error near unexpected token 'ping' Whi
Sign in or unlock PT0-003 to reveal the answer and full explanation for question #17. The question stem and answer options stay visible for context.
Submitted by ashley.k· Mar 6, 2026Reconnaissance and enumeration
Question
A penetration tester writes the following script to enumerate a /24 network:
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?
Exhibit
Options
- AAdd do after line 2.
- BReplace {1..254} with $(seq 1 254).
- CReplace bash with tsh.
- DReplace $i with ${i}.
Unlock PT0-003 to see the answer
You've previewed enough free PT0-003 questions. Unlock PT0-003 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.
Topics
#shell scripting#bash scripting#network enumeration#script debugging
