The following shell script is used to check if the input IP address is invalid o
ID: 3741408 • Letter: T
Question
The following shell script is used to check if the input IP address is invalid or not.
#!/bin/bash
nums=$@
count=_______A._______ # Store the number of arguments from command line
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
Explanation / Answer
Please find my answer:
A.$#
B. ${nums[@]}
C. ${num[0]}
D. ${nums[@]}
E. '0,/99999999/ s/"$min"/'
F. "$min" -gt "$num"