I'm trying to write a program that will ask the user to input the number of values he wants, prompt him for the values and then print out the maximum value and the minimum value.
This is what I have so far:
count=1
echo "Enter number of integers"
read n
while [ $count -le $n ]
do
echo "Enter integer"
read x
current=$x
if [ $current -gt $x ];
then
max=$current
fi
if [ $current -lt $x ];
then
min=$current
fi
done
echo "Max value is $max"
echo "Min value is $min"