Skip to content

Instantly share code, notes, and snippets.

@rileyjshaw
Created June 14, 2017 21:24
Show Gist options
  • Save rileyjshaw/f5302c602cb493bf18b39cd69fb97b4f to your computer and use it in GitHub Desktop.
Save rileyjshaw/f5302c602cb493bf18b39cd69fb97b4f to your computer and use it in GitHub Desktop.
Used this for a quick audit at work. Not comprehensive, but uncovered some good leads nevertheless.
for match in $(egrep -roi '([_a-z])+: function' javascript | cut -d : -f 1-2); do
file=`echo $match | cut -d : -f 1`
fn=`echo $match | cut -d : -f 2`
count=`grep -r $fn javascript | wc -l`
if [[ $count -lt 2 ]]; then
echo "$file:$fn"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment