Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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 done

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Visual Basic6 Database Programming

Authors: John W. Fronckowiak, David J. Helda

1st Edition

0764532545, 978-0764532542

More Books

Students also viewed these Databases questions

Question

b. What are its goals and objectives?

Answered: 1 week ago