IP
shell
#! /bin/bash indicates which shell the script is using, since there are many kinds of shells. For example, Bourne
Shell, Korn Shell, Cshell, etc.
For loop, set I initially to 1, less than or equal to 254, increment each time. In general, 255 is not recommended, so 254 is used here.
The do statement for the loop
If statement
10.0.2 Ping for each value of ${I} in the network segment, ping twice.
If, which means that the IP is used if the ping succeeds.
If the ping succeeds, it will show that the IP was used.
If means the opposite. Ping failed.
If the ping fails, the IP address is not in use.
The end of an if statement, indicating the end of the if statement on a line.
The end of the DO statement. This is the end of the script.
ip
About the IP conflict.
source jcip.sh
su –
./jcip.sh
)