How to iterate over a range of numbers defined by variables in Linux bash shell?

You can use a for loop with range operator ({m,n}) to iterate over a range of numbers.

If you want to define the range dynamically using variables then use seq

Leave a Reply