The syntax {0..10..2} supported only in Bash 4.
For Bash 3, use this syntax instead:
$ for ((i=0; i<=10; i+=2)); do echo "Welcome $i times"; done Welcome 0 times Welcome 2 times Welcome 4 times Welcome 6 times Welcome 8 times Welcome 10 times
You can see what happens in Bash 3.2 if you remove the stepping part of the brace extension:
bash-3.2$ for i in {0..10..2}; do echo "i=>$i"; done i=>{0..10..2} bash-3.2$ for i in {0..10}; do echo "i=>$i"; done i=>0 i=>1 i=>2 i=>3 i=>4 i=>5 i=>6 i=>7 i=>8 i=>9 i=>10
BUT on Bash 4, it works as you please:
bash-4.3$ for i in {0..10..2}; do echo "i=>$i"; done i=>0 i=>2 i=>4 i=>6 i=>8 i=>10
Edit
As Nathan Wilson correctly points out, this is probably a negative result of Bash braceexpand .
You can set this value with set :
$ echo $SHELLOPTS braceexpand:emacs:hashall:histexpand:history:interactive-comments:monitor:posix $ for i in {0..5}; do echo "i=>$i"; done i=>0 i=>1 i=>2 i=>3 i=>4 i=>5 $ set +B $ echo $SHELLOPTS emacs:hashall:histexpand:history:interactive-comments:monitor:posix $ for i in {0..5}; do echo "i=>$i"; done i=>{0..5}
source share