Recursive Word Count With Bash

November 3, 2007

I was curious how many lines were in the new OurUNO rewrite, so I decided to write a little script to find out. Well, that all got out of hand and I kept adding things and masks and depth recursion limiting and I managed to stop myself before I added color to the script, so I did okay I guess.

Anyway, here it is. I’m sure there is some really clever way to do an equivalent one-liner of this, but hey, that’s life.

Bonus! Here’s a tip for posting scripts on the interwebs. Replace your tabs with spaces before copying them into your posts with:
$ cat scriptOrCodeSource | sed 's/\t/ /g'

Update (11/08/07)So that doesn’t work as advertised. I think it’s doing some double counting or something. I’ll post the rewrite when I finish it.
Categories: Geek
Tags: , ,

Leave A Comment

Your email will not be published.