Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The following shell script is used to check if the input IP address is invalid or not. rs = 1 while [$rs -gt 0]; do
The following shell script is used to check if the input IP address is invalid or not. rs = 1 while [$rs -gt 0]; do clear echo -n "Please input the ip: " read ip #use expr to check if the input IP address follows the IP address pattern. iSIP = ____ A. ____ if [____ B. ____ 0]; then # replace each dot by a space in string ip = ____ C. ____ is valid = 0; # loop over the words in string ip for n in ____ D. ____; do if [____ E. ____ -o $n -lt 0]; then echo "ERROR: The number of the IP should not be greater than 255 and less than 0" ____ F. ____ break; fi done if [____ G. ____]; then echo " -----This is a valid IP -----" fi 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 ellipsis" read rs done The following shell script is used to check if the input IP address is invalid or not. rs = 1 while [$rs -gt 0]; do clear echo -n "Please input the ip: " read ip #use expr to check if the input IP address follows the IP address pattern. iSIP = ____ A. ____ if [____ B. ____ 0]; then # replace each dot by a space in string ip = ____ C. ____ is valid = 0; # loop over the words in string ip for n in ____ D. ____; do if [____ E. ____ -o $n -lt 0]; then echo "ERROR: The number of the IP should not be greater than 255 and less than 0" ____ F. ____ break; fi done if [____ G. ____]; then echo " -----This is a valid IP -----" fi 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 ellipsis" read rs done
Step 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