Re: counting lines of code


Subject: Re: counting lines of code
From: Arthur Corliss (acorliss@nevaeh-linux.org)
Date: Wed Feb 11 2004 - 11:27:16 AKST


On Wed, 11 Feb 2004, Thomison, Lee wrote:

>
> Just been tasked to count all lines of code in our app's src directory.
> This includes the whole tree structure, comments and everything. (SWAG
> estimate is maybe 4 million lines or so).
>
> Of course, they want it yesterday....
>
> My usual script only works on a single file as written, but I can
> enhance it to cover all files in the current directory (there are no
> binaries in this tree structure. Supposedly.) But my shell scripting
> is not sufficient to modify it to go thru a whole tree structure of
> unknown depth and breadth.

find . -name '*.c' -exec cat \{\} \; | wc -l

If you need every file, not just source code files, you might change the
"-name '*.c'" to "-type f".

        --Arthur Corliss
          Bolverk's Lair -- http://arthur.corlissfamily.org/
          Digital Mages -- http://www.digitalmages.com/
          "Live Free or Die, the Only Way to Live" -- NH State Motto
---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.



This archive was generated by hypermail 2a23 : Wed Feb 11 2004 - 11:28:13 AKST