Monday, 16 June 2008

Bash: printing the alphabet

(Sorry for the geeky topic, non-geeky readers)

Most have probably run across the "seq" command that will let you generate a list of numbers:
$ seq 1 4
1
2
3
4
But you can do similar with "echo" for a list of letters:

$ echo {a..d}
a b c d
$ echo {a..d}{a..d}
aa ab ac ad ba bb bc bd ca cb cc cd da db dc dd

6 comments:

Anonymous said...

This came in handy, thanks!

Anonymous said...

Thank you. You save my time ;-)

Anonymous said...

Thanks! This helped a lot and made one of my scrips a lot simpler!

manu g.m. said...

super awesome. thanks.

Smilyface said...

Great..

Anonymous said...

gr8