Here is another way ... influenced by the chepner solution , but not using seq :
The contents of script.sh:
#!/bin/bash read -p "Enter a Number great than 1: " counter range=( $(eval echo {$counter..1}) ) ( IFS=,; echo "${range[*]}" )
Test:
$ bash script.sh Enter a Number great than 1: 5 5,4,3,2,1 $ bash script.sh Enter a Number great than 1: 30 30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1
source share