Write a Shell Script to read n numbers as command arguments and sort them in descending order
echo "Enter N"
read n
for (( i = 1; i <= n; i++ )); do
echo "Enter Array ["$i"] : "
read array[i]
done
for (( i = 1; i <= 5; i++ )); do
for (( j = i+1; j <= 5; j++ )); do
if [[ ${array[i]} > ${array[j]} ]]; then
temp=${array[i]}
array[i]=${array[j]}
array[j]=$temp
fi
done
done
echo "Elements of sorted array:-"
for (( i = 1; i <= 5; i++ )); do
echo ${array[i]}
done