Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Is this possible/easy?



Jason Price wrote:
>I need to generate a script to ping all the IP addresses in a couple
>of class C's.  (So we can double check our records, and see which are
>in use) Is there a way to generate this easilly?

for n in {0..255}; do
  ping 150.150.150.$n
done

or, with 3.1, and less dependent on options,

for((n=0; n<256; n++)); do
  ping 150.150.150.$n
done

I actually have a program that performs a related task, that uses both
of the above methods at different points, for maximal efficiency.

-zefram



Messages sorted by: Reverse Date, Date, Thread, Author