Skip to content

Instantly share code, notes, and snippets.

@bruno2ms
Created November 14, 2017 18:45
Show Gist options
  • Save bruno2ms/6264b239d637a2d7a6279987a647d94e to your computer and use it in GitHub Desktop.
Save bruno2ms/6264b239d637a2d7a6279987a647d94e to your computer and use it in GitHub Desktop.
# Gera um arquivo com todas as ocorrencias do arquivo, considerando pasta/nome_do_arquivo.js
find . -wholename '**/Content/*.js' | awk -F'/' -v OFS='/' '{print $(NF-1), $NF}' | sort | while read fname; do
echo ">>>>> $fname" >> lista-scripts.txt;
git grep -ni --threads 8 $fname >> lista-scripts.txt;
echo "" >> lista-scripts.txt;
done;
# Gera um relatrio de arquivos js com quantidade de linhas
find . -wholename '**/Content/*.js' | xargs wc -l >> lista-scripts-linhas.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment