while read p || [[ -n $p ]]; do
host ${p} >> result.txt
done < hosts.txt
exec 4< /dev/com1
cat <&4
exec 4<&-
myservice -port 8008