#!/bin/sh # # pinghosts - ping hosts in /etc/hosts, output is coloured (red=bad). Ver 1.00. # # 25-Jun-2003 Brendan Gregg Created this mini script. for host in `awk '/^[0-9]/ { print $1 }' /etc/hosts` do echo "Checking $host: \c" ping $host 1 2>&1 | \ sed 's/.*no answer.*/&/;s/.*is alive.*/&/' done