src/tools/perlcheck/find_perl_files
raw| 1 | # src/tools/perlcheck/find_perl_files |
| 2 | |
| 3 | # shell function to find all perl files in the source tree |
| 4 | |
| 5 | find_perl_files () { |
| 6 | if [ $# -eq 0 ]; then |
| 7 | echo 'No files to process' 1>&2 |
| 8 | return |
| 9 | fi |
| 10 | { |
| 11 | # take all .pl and .pm files |
| 12 | find "$@" -type f -name '*.p[lm]' -print |
| 13 | # take executable files that file(1) thinks are perl files |
| 14 | find "$@" -type f -perm -100 -exec file {} \; -print | |
| 15 | egrep -i ':.*perl[0-9]*\>' | |
| 16 | cut -d: -f1 |
| 17 | } | sort -u | grep -v '^\./\.git/' |
| 18 | } |