Description:
Write a shell script that accepts exactly 1 argument which must be a positive integer.
The script will print a comma-separated list of integers, all on the same line in descending order
Script: decreaseNum.sh
#!/bin/bash#-----------------------------------------------#user inputnum=$1temp=''
#continue while input is greater than 0
while [ $num -gt 0 ]
do
while [ $num -gt 0 ]
do
#append the numbers in decreasing order with comma-separated
temp+="$num, "
num=$(( $num - 1 ))
done
temp=$(echo $temp | sed 's/,$//')
temp+="$num, "
num=$(( $num - 1 ))
done
temp=$(echo $temp | sed 's/,$//')