#!/bin/bash for((i=1;i<=255;i++)) #do ping -c 3 10.68.7.$i 1>/dev/null 2>/dev/null do ping -c 1 10.68.7.$i 1>/dev/null 2>/dev/null if [ ! $? -eq 0 ] then echo 10.68.7.$i fi done