while read host; do echo "$host"; done < server.txt
With the code you provided, the file as a single string is given as the 4th argument to the for
command. The shell then splits the string using arbitrary whitespace as a delimiter (assuming you have not altered the IFS
variable).