Question: 3) (9 points) The following shell script is used to check if the input IP address is invalid or not. Hint: grep returns 0 ifa

3) (9 points) The following shell script is used to check if the input IP address is invalid or not. Hint: grep returns 0 ifa pattern is found. rs=1 while Srs-gt 0l: do clear echo -n "Please input the ip:" read ip #use grep to check if the input IP address follows the IP address pattern isIp if $isIP -] ; then isValid-1; # loop over the words in string for i in : do n="echo $ip | cut -d. if n -gt 255 -o -f$1" l; then echo "ERROR: The number of the IP should not be greater than 255 and less than 0" fi done if [ then echo"--This is a valid IP-" else echo "ERROR: The IP format you input is wrong, the format should be like 192.168.100.1" fi echo echo-n "Press 0 to exit and other numbers to continue..." read rs
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
