Skip to content

Instantly share code, notes, and snippets.

@dobrokot
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dobrokot/82ade3a1c399573922b8 to your computer and use it in GitHub Desktop.
Save dobrokot/82ade3a1c399573922b8 to your computer and use it in GitHub Desktop.
(
find . -name '*.cpp' -or -name '*.h' | xargs grep -E '^ *[a-zA-Z0-9< >,:_]+ +[a-zA-Z0-9_]+;$' -o -h | grep '<' | grep '>' ;
find . -name '*.cpp' -or -name '*.h' | xargs grep -E '^ *[a-zA-Z0-9_]+ +[a-zA-Z0-9_]+;$' -o -h
) | awk '{print $2}' | sort -u | tr -d ';' > ../names.txt
find . -name '*.cpp' -or -name '*.h' | xargs fgrep --word-regexp -f ../names.txt -oh | sort | uniq -c | awk '$1 <= 2'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment