#!/bin/bash for id in `nmap -sPn 192.168.1.0/27 |grep report |awk '{print $NF}' |tr -d '()'`;do ping -W 1 -c 1 -f $id;done