Course Solutions Uncategorized (Solved) : Following Shell Script Used Check Input Ip Address Invalid Hint Grep Returns 0 Pattern Fo Q27957140 . . . .

(Solved) : Following Shell Script Used Check Input Ip Address Invalid Hint Grep Returns 0 Pattern Fo Q27957140 . . . .

 

The following shell script is used to check if the input IPaddress is invalid or not.
Hint: grep returns 0 if a pattern is found.

Fill in the Blanks!

#!/bin/bash
nums=$@
count=_______A._______ # Store the number of arguments from commandline
nums=” “$nums” “
# Prints the number before sorting
echo -n “Original Numbers typed:”
for num in _______B._______
do
echo -n “$num “
done
echo
res=””
# Now do the Sorting of numbers
for n in `seq 1 $count`
do
min=_______C._______ # Get the first int from nums
for num _______D._______
do
if [_______E._______]
then
min=$num;
fi
done
res=”$res $min”
nums=`echo “$nums”|sed _______F._______`
done
echo -n “Sorted Numbers:”
echo $res

Expert Answer


An answer will be send to you shortly. . . . .

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post