I want to get all the servers' time with ssh, but my script only loops once and then exit, what's the reason?
servers.txt
192.168.1.123
192.168.1.124
192.168.1.125
192.168.1.126
gettime.sh
#!/bin/bash
while read host
do
ssh root@${host} date
done < "servers.txt"
OUTPUT
Tue Feb 3 09:56:54 CST 2015