I do know how the ping itself determ. if the host is up or not but what I need to know is how does the script determine if the ping got a reply

ei: if (insert what here???) echo "host alive"