Skip to content

Instantly share code, notes, and snippets.

@enriched
Last active May 2, 2016 19:20
Show Gist options
  • Save enriched/b61846e7dffc9dcdb2181c6ed0435d6c to your computer and use it in GitHub Desktop.
Save enriched/b61846e7dffc9dcdb2181c6ed0435d6c to your computer and use it in GitHub Desktop.
Ping with packet loss % and millisec output
usefulbashping()
{
read loss rttavg <<< $(ping -q -c 100 -w 60 -A $1 | \
awk 'BEGIN {FS="[/ ]"}; /loss/ {print substr($6,0,length($6))}; /rtt/ {print $9*1000}')
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment