Date: Tue, 23 Dec 2003 15:33:28 +0800 From: "Zhang Weiwu" <weiwuzhang@hotmail.com> To: freebsd-questions@freebsd.org Subject: How to count the lines of code in a project? Message-ID: <Law11-F62pzhad2VqKw0005fb4d@hotmail.com>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Law11-F62pzhad2VqKw0005fb4d>