Skip to content

Instantly share code, notes, and snippets.

@peeyushsrj
Created December 19, 2019 18:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peeyushsrj/87f90919e489994572eafaf75c10c9d5 to your computer and use it in GitHub Desktop.
Save peeyushsrj/87f90919e489994572eafaf75c10c9d5 to your computer and use it in GitHub Desktop.
Count function call python using bash
source="*.py"
funcs=$(cat $source | grep 'def' | sed 's/def //g' | sed 's/(.*/(/' | grep -v '#')
for f in $funcs
do
echo $f $(expr $(cat $source | grep -c $f) - 1)
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment