Search code examples
command-linegrepfindxargspylint

How can I find, xargs and grep the resulting output?


I would like to check the 'code rating' for each Python file in a directory. The name of the file and its rating should be printed.

I thought the following would at least print all code ratings:

find . -name '*.py' -print0 | xargs -0 pylint  | grep "has been rated"

However, it prints only one code rating. Why? How do I fix it?


Solution

  • Try:

    find . -name '*.py' -exec pylint {} \; | grep "has been rated"