Here's script to do that if anyone is interested...
find /data/washingtonpost/timespace -path '/data/washingtonpost/timespace/lib' -prune -o -name '*.py' -exec wc -l {} \; | awk '{count+=$1} END {print count}'
That will look in the first directory specified, /data/washingtonpost/timespace in my case and will ignore anything in the second directory, which is my python lib and all code I didn't write. Then we pass the or switch, tell it to match files ending in .py and execute word count to count the lines in the file. That then get's piped over to awk where we grab the first field and keep track of those values in a variable and when the program ends print the count. Probably other ways to do that but this one works for me.
I had every intention of blogging before a week passed by but it didn't happen.
No comments:
Post a Comment