I generally do something like this:
for host in 10.1.0.{1..254}; do fping $host; done
Thanks,
James
On Fri, Dec 3, 2010 at 2:14 AM, Per Jessen
David C. Rankin wrote:
Guys,
What would I use to get a list of hosts on the local subnet aside from dumping the forward zone in bind or doing a ping -c .1 subnet.1-254? I want to find something I can call from a script to return the list to either a single variable or an array.
I'm open to anything, but would prefer a BASH or c solution.
The arp variations already suggested are probably enough, but if you're on the dhcp machine, you could take a look at the dhcp lease file. (assuming you already know about the "fixed" hosts).
-- Per Jessen, Zürich (-3.9°C)
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org