<div dir="ltr">Hi,<br><br>If you you want a quicker execution - you could also run the pings to separate hosts in parallel starting the jobs in background (&) and waiting for them with "wait" after that. You'll have to be more careful about the outputs in that case - e.g. redirect them to separate files.<br>
<br>Regards,<br>Javor<br><br><div class="gmail_quote">On Mon, Jul 28, 2008 at 2:57 PM, Laurence Alexander Hurst <span dir="ltr"><<a href="mailto:L.A.Hurst@lboro.ac.uk">L.A.Hurst@lboro.ac.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">Gopinath Achari wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
hi,<br>
<br>
                how to write a scripts which launches 10 pings to different<br>
destinations at execution of single shell scripts<br>
<br>
please help me any ideas<br>
<br>
regards,<br>
Gopinath<br>
</blockquote></div>
Do you mean something like:<br>
ping -c10 host1<br>
ping -c10 host2<br>
....<br>
which will ping host1 10 times, then host2 10 times etc. (see `man ping` for details of the options).<br>
<br>
If you have a list of hosts in a file, you could do:<br>
for host in `cat [filename]`<br>
do<br>
        ping -c10 $host<br>
done<br>
<br>
or:<br>
<br>
while read host<br>
do<br>
        ping -c10 $host<br>
done << [filename]<br>
<br>
If you only want to ping each host once, you can substitute '-c10' with '-c1' (again, see the man page).<br>
<br>
Hope this helps<br><font color="#888888">
Laurence</font><div><div></div><div class="Wj3C7c"><br>
_______________________________________________<br>
CentOS mailing list<br>
<a href="mailto:CentOS@centos.org" target="_blank">CentOS@centos.org</a><br>
<a href="http://lists.centos.org/mailman/listinfo/centos" target="_blank">http://lists.centos.org/mailman/listinfo/centos</a><br>
</div></div></blockquote></div><br></div>