Help With Ping Script

Hello all...I'm new to Unix and learning. What I'm trying to create is a script that will ping a known range of IP addresses, say 192.168.1.1 to 192.168.1.254. For each address that no reply is received, that address will be written to a log file that will be emailed to an administrator. My wife (who started out as a programmer) hasn't been able to help because she hasn't done anything with Unix since 2000. Any help would be greatly appreciated. Here's a script that I think comes close but it isn't quite there and I'm not sure how to modify it.

HOSTS="Hostname Here"

# no ping request
COUNT=1

# email report when
SUBJECT="Ping failed"
EMAILID="me@mydomain.com"
for myHost in $HOSTS
do
count=$(ping -c $COUNT $myHost | grep 'received' | awk -F',' '{ print $2 }' | awk '{ print $1 }')
if [ $count -eq 0 ]; then
# 100% failed
  
fi
done
echo "Host : $myHost is down (ping failed) at $(date)" | mail -s "$SUBJECT" $EMAILID

You don't need the count variable.

ping retruns false if failed so you can:

if ! ping -c $COUNT $myHost; then
   # 100% failed
fi