EnderUNIX Team.


EnderUNIX tips

Mail to My Friend , Home Page

[ Shell Scripting ]

"PING THE HOST TABLE" - Ülkü SAYILAN - (2003-12-10 23:18:51)   [6320]

PING THE HOST TABLE

There's no need to grep and pipe the output into awk (you can "grep" with awk.)

awk '/^[0-9]/{print $1}' /etc/hosts |xargs -l ping -c 1 $1


And another:

awk '/^[^#]/ {system("ping -c 1 "$1)}' < /etc/hosts


Mail to My Friend , Home Page