I wanted to count the lines of code for a project I was working on and realized that it can be done with some simple regexp and commands. Thought I'd share:
find dir -type f | egrep "(\.xml|\.java|\.jsp|\.tag|\.sql|\.html|\.tld|\.css)$" | xargs cat | egrep -v "^[\s\t]*$" | wc -l
I was surprised that there are companies that sell software to do the above. God I hate over engineering
Sami, be careful, that last line is borderline subversive talk in your current surroundings. FYI, I was at the HOJ on Thursday (first time in months). Maybe I'll see you there next time.
ReplyDeleteHOJ?A new name for WTF?
ReplyDeleteI am on the hairy edge :)... Hope to see at HOJ soon
ReplyDelete