I need to write a bash shell script that will check a range of IP addresses to see if a host is “alive” at that address.I also need to list the IP numbers of those that are “alive”, and provide a summary showing the number of “alive” and “not alive” IP addresses. The range of addresses will all be in a “Class C” network. I'm having problems figuring out how to pass through each arg and get it pinging each individual address within the range.
Below is a sample run of the script I intend to create.
$ programName 192.168.42 18 22 Checking: 192.168.42.18 19 20 21 22 Live hosts: 192.168.42.21 192.168.42.22 There were: 2 alive hosts 3 not alive hosts found through the use of 'ping'.