🔥 3-day streak
CompTIA Linux+ (XK0-006)22 / 123
Question 22 of 123

A DevOps engineer needs a Bash script to process a file named servers.txt that contains one hostname per line, including some lines with embedded spaces and trailing whitespace. Each hostname must be read exactly as written and passed to a ping check. Which loop construct correctly reads the file line by line while preserving leading/trailing whitespace and avoiding word splitting?

Reviewed for accuracy · Report an issueNext question