write shell script to reverse a number

in this tutorial i'm going to show you using for loop reverse a number in shell script
print 1 to 20 numbers in reverse.

code:


for (( i=20;i>0;i++)
do
echo “$i”
done


output:-

20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1

Post a Comment

If you have any doubts, Please let me know
Thanks!

Previous Post Next Post