【问题标题】:How can I find, xargs and grep the resulting output?我怎样才能找到 xargs 和 grep 结果输出?
【发布时间】:2014-11-04 16:31:54
【问题描述】:

我想检查目录中每个 Python 文件的“代码评级”。应打印文件名及其评级。

我认为以下内容至少会打印所有代码评级:

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

但是,它只打印一个代码等级。为什么?我该如何解决?

【问题讨论】:

    标签: command-line grep find xargs pylint


    【解决方案1】:

    试试:

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

    【讨论】:

    • 我怎样才能额外打印到文件名?
    • 找到 . -name '*.py' -print -exec pylint {} \; | egrep 'py$|已被评级'
    猜你喜欢
    • 2013-08-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多