A better way to list only the directories in the current directory might be:
Code:
find . -maxdepth 1 -type d
I say that this is better because it explicitly only lists directories, and does it within a single program. However, elija's approach is quite reasonable, and depending on what sort of processing you want to do with the data, may be better.