Skip to main content
edited tags; edited title
Link
codeforester
  • 43.8k
  • 21
  • 122
  • 159

How to produce a range with step n in bash? (generate a sequence of numbers with increments)

How to produce range with step n in bash? (generate a sequence of numbers with increments)

Source Link
SilentGhost
  • 322.1k
  • 67
  • 312
  • 294

How to produce range with step n in bash?

The way to iterate over a range in bash is

for i in {0..10}; do echo $i; done 

What would be the syntax for iterating over the sequence with a step? Say, I would like to get only even number in the above example.