Printing a sequence of letters or numbers
Shell Tips
January 14, 2008 | COMMENTS

Some times, while scripting in your favorite shell (I mean Bash !! 😃 you need to print a sequence of letters or numbers. Don’t write it yourself ! Script it using seq or curly braces !

nicolas@macvin:~$ seq 1 10
1 2 3 4 5 6 7 8 9 10
nicolas@macvin:~$ seq 0 2 10
0 2 4 6 8 10
nicolas@macvin:~$ echo {1..10}
1 2 3 4 5 6 7 8 9 10
1
2
3
4
5
6
nicolas@macvin:~$ echo {a..g}
a b c d e f g
1
2

Hope this will help you while doing a loop or building some hash directories :

nicolas@macvin:~$ mkdir -p test/{1..10}/{1..10}

Enjoy !