Created
September 10, 2014 14:55
-
-
Save epower/659cd3a2fd2f6b94b155 to your computer and use it in GitHub Desktop.
ping test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ping $1 | awk '{ sent=NR-1; received+=/^.*(time=.+ ms).*$/; loss=0; } { if (sent>0) loss=100-((received/sent)*100) } { printf "sent:%d received: %d loss:%d%%\n", sent, received, loss }' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment