How to print nos as 5,4,3,2,1 using while loop in using shell script?

How to print nos as 5,4,3,2,1 using while loop in using shell script?

Senior Developer Asked on December 7, 2017 in LINUX.
Add Comment
1 Answer(s)

 

#!/bin/bash
n=6

while [ $n != 1 ]

do
n=$(($n - 1 ))

echo $n

done

 

Team Leader Answered on December 27, 2017.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.