Results 1 to 4 of 4
Dear Friend
I have a file in root directory named as test_all_ping where I have inserted below code to ping multiple IP.
Code:
for i in $(cat ips.list); do
ping ...
- 08-04-2009 #1Just Joined!
- Join Date
- Sep 2008
- Posts
- 2
create executable file and run that
Dear Friend
I have a file in root directory named as test_all_ping where I have inserted below code to ping multiple IP.
Is that ok? If yes, please let me know, how can I make that file executable and after that how can I run that to see multiple IP by using the above executable file.Code:for i in $(cat ips.list); do ping ${i} done
Appreciate, if you would come back at your earliest.
Regards
Pervez
- 08-04-2009 #2
Your script looks okay but you say you have it in your root directory. It would be better to store it in your /home directory or, if you want every user to have access to it then place it in a folder in your path such as /usr/bin
You can then make your file executable by using the command:
You can then run your script by simply usingCode:chmod a+x test_all_ping
Code:./test_all_ping
Linux User #453176
- 08-04-2009 #3Linux Newbie
- Join Date
- Apr 2009
- Posts
- 160
if you put it in /usr/bin you don't need the ./ in the beginning just use test_all_ping
- 08-04-2009 #4
your script has a logic error in it though, you need to read the man page on ping, by default it pings the address infinitely, so in your script you will never ping more than 1 device, and the script will run endlessly pinging that first device.


Reply With Quote