root@OpenWrt:~# cat foo time.nist.gov this is the first server tock.ucla.edu this is the second server root@OpenWrt:~# cat foo | while read name server; do { echo "$name"; } done time.nist.gov tock.ucla.edu root@OpenWrt:~#