#!/bin/bash host1=unitymedia.de host2=stefanfrings.de host3=www.google.de while true; do res1=`ping -n 1 -w 1000 $host1 | awk -F' |=' 'NR==3 {print $7}'` res2=`ping -n 1 -w 1000 $host2 | awk -F' |=' 'NR==3 {print $7}'` res3=`ping -n 1 -w 1000 $host3 | awk -F' |=' 'NR==3 {print $7}'` date=`date +'%d.%m.%Y %H:%M:%S'` printf "%-20s %-10s %-10s %-10s\n" "$date" "$res1" "$res2" "$res3" sleep 10 done | tee -a dauerping.log