Re: Getting loc



On Jun 7, 3:43 pm, "Aaron Gray" <ang.use...@xxxxxxxxx> wrote:
Hi,

I have asked this question before but cannot find the thread on Google
Groups.

Basicaly I want a line of shell code that counts the number of non blank
lines of code in a file, directory or directory tree.

Many thanks in advance,

Aaron

for a file or dir:

grep -e '[a-zA-Z]' srcfile | wc

for a tree it would be a bit more complicated. You'd need to sum up
the outputs from the above.

But really SLOC counts should omit comments too - thats a bit more
tricky.

C.
.



Relevant Pages

  • Re: Getting loc
    ... I have asked this question before but cannot find the thread on Google ... Basicaly I want a line of shell code that counts the number of non blank ... lines of code in a file, directory or directory tree. ... Useless use of cat ...
    (alt.os.linux)
  • Re: Getting loc
    ... I have asked this question before but cannot find the thread on Google ... Basicaly I want a line of shell code that counts the number of non blank ... lines of code in a file, directory or directory tree. ... the brackets. ...
    (alt.os.linux)
  • Re: Getting loc
    ... Aaron Gray wrote: ... I have asked this question before but cannot find the thread on Google ... Basicaly I want a line of shell code that counts the number of non blank ... lines of code in a file, directory or directory tree. ...
    (alt.os.linux)
  • Re: Getting loc
    ... I have asked this question before but cannot find the thread on Google ... Basicaly I want a line of shell code that counts the number of non blank ... lines of code in a file, directory or directory tree. ... or do you count them for each time the source file is ...
    (alt.os.linux)