De: link
com pouco script ...
ping -D localhost | while read row
do
awk '{ sub(/[0-9]{10}/, strftime("%Y-%m-%d %H:%M:%S", substr($0,2,10))) }1' <<< "$row"
done
é executado como
$ ping -D localhost | while read row; do awk '{ sub(/[0-9]{10}/, strftime("%Y-%m-%d %H:%M:%S", substr($0,2,10))) }1' <<< "$row" ; done
PING localhost (127.0.0.1) 56(84) bytes of data.
[2014-11-10 16:06:40.145811] 64 bytes from localhost (127.0.0.1): icmp_req=1 ttl=64 time=0.045 ms
[2014-11-10 16:06:41.144926] 64 bytes from localhost (127.0.0.1): icmp_req=2 ttl=64 time=0.040 ms