This is a modification of @david-rodrÃguez-dribeas answer above, which runs all the pings in parallel (much faster) and only shows the output for ip addresses which return the ping.
export COUNTER=1
while [ $COUNTER -lt 255 ]
do
ping $1$COUNTER -c 1 -w 400 | grep -B 1 "Lost = 0" &
COUNTER=$(( $COUNTER + 1 ))
done