Xref: utzoo comp.software-eng:1910 comp.lang.c:20991 Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!gem.mps.ohio-state.edu!ginosko!uunet!kddlab!titcca!dclsic!soumgw!rena!ascgw!pbguru!kazua-u From: kazua-u@ascii.JUNET (Kazuaki Ueno) Newsgroups: comp.software-eng,comp.lang.c Subject: Re: C source lines in file Message-ID: Date: 14 Aug 89 12:15:41 GMT References: <35120@ccicpg.UUCP> Sender: news@pbguru.ascii.junet Followup-To: comp.software-eng Organization: ASCII Corporation, Tokyo, Japan. Lines: 19 In-reply-to: swonk@ccicpg.UUCP's message of 11 Aug 89 01:54:46 JST In article <35120@ccicpg.UUCP> swonk@ccicpg.UUCP (Glen Swonk) writes: |Does anyone have a program or a method of determing |the number of C source lines in a source file? |My assumption is that comments don't count as source |lines unless the comment is on a line with code. | How about trying this: grep -v '^#[ ]*include' | /lib/cpp -P | grep -v '^[ ]*$' | wc -l ( Inside []'s are a SPACE and a TAB. ) You will get the number of 'effective' C source lines with this list of commands. Of course I do not care what you do with it. :-) -- Kazuaki Uyeno ASCII Corporation, Tokyo, Japan also a student of Univ. of Tokyo kazua-u@ascii.JUNET