- Bash Script: Increment the loop by some value on each iteration

Below is the simple bash script which show the way of incrementing the for loop by the value of "2" on each iteration:


#!/bin/bash
for i in {1..10..2}
do
    echo $i
done

=== Output ====
1
3
5
7
9




source:http://linuxpoison.blogspot.com/2012/05/135781677511298.html