Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Dec 2003 08:39:52 +0100
From:      Bernard El-Hagin <bernard.el-hagin@lido-tech.net>
To:        freebsd-questions@freebsd.org
Subject:   Re: How to count the lines of code in a project?
Message-ID:  <b8sfuv0ie4vmcjkhfeg0q6icmv3ndv4g86@4ax.com>
In-Reply-To: <Law11-F62pzhad2VqKw0005fb4d@hotmail.com>
References:  <Law11-F62pzhad2VqKw0005fb4d@hotmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
owner-freebsd-questions@freebsd.org wrote:

>
>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=3De+/" > =
/tmp/countlines.py
>
>And edit the py file, and "e=3D0" 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?


I think a *slightly* better method is to use:


wc -l *.c


;-)


--=20
Cheers,
Bernard



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?b8sfuv0ie4vmcjkhfeg0q6icmv3ndv4g86>