Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please fill in the blanks 3) (9 points) The following shell script is used to check if the input IP address is invalid or not.
Please fill in the blanks
3) (9 points) The following shell script is used to check if the input IP address is invalid or not. Hint: grep returns 0 if a pattern is found. F8-1 while Srs -gt o i do clear echo -n Please input the ip: read ip #use grep to check if the input IP address follows the IP address pattern A. 18IP- if t SisiP c.-] ; then isvalid-1; # loop over the words in string ip for i in -;do n-echo sip | cut -d. -fri if [ Sn -gt 255 -o li then echo "ERROR: The number of the IP should not be greater than 255 and less than o fi done if fi li 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 doneStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started