How can I make the list of letters from A to Z and iterate through them in the shell?

vehomzzz picture vehomzzz · Sep 22, 2009 · Viewed 12.9k times · Source

Say I want to iterate from letter A to letter Z in csh shell. How do I succinctly do that?

In bash I would do something like

for i in 'A B C ...Z'; do echo $i; done

The point is I don't want to write A through Z, I want something like

[A-Z]

Can you suggest a one line suggestion in AWK or Perl?

Answer

Sinan Ünür picture Sinan Ünür · Sep 22, 2009
perl -e 'print for "a" .. "z", "A" .. "Z", 0 .. 9'