title: How to get the percent of packets received from Ping in bash?
body: <p>When pinging a host I want my output just to show the percentage of packets (5 sent) received. I assume I need to use <code>grep</code> somehow but I can't figure out how (I'm new to bash programming). Here is where I am: <code>ping -c 5 -q $host | grep ?</code>. What should go in grep? I think I will have to do some arithmetic to get the percent received but I can deal with that. How can I pull out the info I need from the summary that ping will output?</p>