Terminal Ping, how to get simple integer
Try this:

ping -c 1 google.com | grep "time=" | sed -E "s/(.*)time=([.0-9]+) ms/\2/"


If you want to get an minimal value for some number of requests use:

ping -q -c 5 google.com | tail -1 | cut -d "=" -f 2 | cut -d "/" -f 1


Replace 1 in -f 1 with:


2 for average
3 for maximum