On Tue, Jan 22, 2002 at 12:50:56PM +1300, Nick Rout wrote:
> for letter in a b c ; do
> [the action]
> done ;
>
> But is there a shorthand for ttyping ut every letter of the alphabet?
> something like
>
> for letter in [a-z] ; do
there is a directory for every letter in the alphabet in /usr/share/terminfo
you could use:
for i in `(cd /usr/share/terminfo;echo [a-z])`; do
oh, wait, it's missing a y, let's add that:
for i in `(cd /usr/share/terminfo;echo [a-z])` y; do
you want them in alphabetical order? ok:
for i in `((cd /usr/share/terminfo;ls -d [a-z];echo y)|sort)`; do
you think that's to much typing? well:
for i in a b c d e f g h i j k l m n o p q r s t u v w x y z; do
is longer than at least the first two.
or how about perl?
for i in `perl -e 'print Aa..Az'|tr A " "`; do
wow, that's even shorter.
(there probably is a way to add the spaces using perl, but i am sure
it would be more typing)
pike does not offer a similar trick,
it can safe you from typing spaces, though:
for i in `pike -e 'write("abcdefghijklmnopqrstuvwxyz"/""*" ")'`; do
well, take your pick...
greetings, martin.
--
i am looking for a job anywhere in the world, doing pike programming,
caudium/pike/roxen training, roxen/caudium and/or unix system administration.
--
pike programmer Traveling in Korea (www|db).hb2.tuwien.ac.at
unix (iaeste|bahai).or.at (www.archlab|iaeste).tuwien.ac.at
systemadministrator (stuts|black.linux-m68k).org mud.at is.(schon.org|root.at)
Martin B"ahr http://www.iaeste.or.at/~mbaehr/