As an excercise i'd like to write ping sweeper in bash script but there are 2 things i'd like to know. (I know that for you experts it's gonna be easy but don't laugh)

1. How do I make ping command ping the host only once?
2. How does the program determine if the host is alive or not?