How to count the lines of code in a project?

Zhang Weiwu weiwuzhang at hotmail.com
Mon Dec 22 23:33:29 PST 2003


Hello. How to count the number of lines in all *.c file in a directory?

I can think of this on csh:

> grep -c "" `find . -name "*.c"` | sed "s/.*:/e=e+/" > /tmp/countlines.py

And edit the py file, and "e=0" as first line, "print e" as the last
line, and execute the python script. wooo pretty cool for a newbie like
me:)

So is there a better method?

_________________________________________________________________
ÏíÓÃÊÀ½çÉÏ×î´óµÄµç×ÓÓʼþϵͳ¡ª MSN Hotmail¡£  http://www.hotmail.com  



More information about the freebsd-questions mailing list