Created
July 1, 2011 03:14
-
-
Save allex/1057802 to your computer and use it in GitHub Desktop.
Counting linux source code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . -name \*.h -exec wc {} \; > /tmp/src.txt | |
find . -name \*.c -exec wc {} \; >> /tmp/src.txt | |
cat sample.py | |
total = 0 | |
myfile = open('src.txt') | |
lines = myfile.readlines() | |
for line in lines: | |
print line.split()[0] | |
total += int(line.split()[0]) | |
print total |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment