Never been to TextSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

About this user

Sencer http://www.sencer.de

« Newer Snippets
Older Snippets »
1 total  XML / RSS feed 

SLOC of php source code

This shell snippet counts all lines in all .php files (in and beneath the current path ".") that are non-blank and not comments (yes, it also discards multiline comments).

find . -name '*.php' | xargs cat | sed -re ':top /\/\*.*\*\// { s/\/\*.*\*\///g ; t top }; /\/\*/ { N ; b top }' | awk '$0 !~ /^[\t[:space:]]*($|(\/\/)|(#))/' | wc -l
« Newer Snippets
Older Snippets »
1 total  XML / RSS feed